This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181184 - spellchecker classes loaded on start
Summary: spellchecker classes loaded on start
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Spellchecker (show other bugs)
Version: 6.x
Hardware: Other Linux
: P3 normal (vote)
Assignee: Jan Jancura
URL:
Keywords: PERFORMANCE, REGRESSION
Depends on:
Blocks:
 
Reported: 2010-02-25 01:33 UTC by Jaroslav Tulach
Modified: 2010-03-30 13:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2010-02-25 01:33:54 UTC
Recent while list tests indicate that there is significant increase in # of new loaded classes:
http://deadlock.netbeans.org/hudson/job/ergonomics/
http://wiki.netbeans.org/FitnessViaWhiteAndBlackList

    org.netbeans.modules.spellchecker.ComponentPeer
    org.netbeans.modules.spellchecker.CompoundDictionary
    org.netbeans.modules.spellchecker.DefaultLocaleQueryImplementation
    org.netbeans.modules.spellchecker.DictionaryImpl
    org.netbeans.modules.spellchecker.DictionaryProviderImpl
    org.netbeans.modules.spellchecker.DictionaryProviderImpl$LocaleIterator
    org.netbeans.modules.spellchecker.Installer
    org.netbeans.modules.spellchecker.LookupAccessor
    org.netbeans.modules.spellchecker.SpellcheckerHighlightLayerFactory
    org.netbeans.modules.spellchecker.TokenListProviderFolder
    org.netbeans.modules.spellchecker.TrieDictionary
    org.netbeans.modules.spellchecker.bindings.java.JavaSemanticTokenList$FactoryImpl
    org.netbeans.modules.spellchecker.plain.PlainTokenList
    org.netbeans.modules.spellchecker.plain.PlainTokenListProvider
    org.netbeans.modules.spellchecker.spi.LocaleQueryImplementation
    org.netbeans.modules.spellchecker.spi.dictionary.Dictionary
    org.netbeans.modules.spellchecker.spi.dictionary.DictionaryProvider
    org.netbeans.modules.spellchecker.spi.language.TokenList
    org.netbeans.modules.spellchecker.spi.language.TokenListProvider

Sample stack traces are available at the ergonomics build page. The central part seems to be some ComponentPeer. It remains to be explained why it (and its peer classes) gets initialized without the user trying to open editor or enter anything into a text field.
Comment 1 Jaroslav Tulach 2010-02-25 02:43:35 UTC
Priority adjusted to comply with "regression" keyword and the fact that failing tests "block developer progress".
Comment 2 Jan Lahoda 2010-02-25 03:13:11 UTC
jjancura is responsible for the integration, AFAIK.

I guess that the reason why ComponentPeer runs is because of the Quick Search field, although this field should not really be spellchecked, of course. I think, however, that at least the Installer class (+innerclasses) will need to be loaded.

(In reply to comment #1)
> [failing] tests "block developer progress".

I though that the parallel integration is supposed to prevent these problems?
Comment 3 Jaroslav Tulach 2010-02-26 07:04:53 UTC
Also testNoWrites is failing: 
http://deadlock.netbeans.org/hudson/job/ergonomics/lastCompletedBuild/testReport/org.netbeans.test.ide/GeneralSanityTest/testNoWrites/



junit.framework.AssertionFailedError: No writes during startup.
Writing any files to disk during start is inefficient and usualy unnecessary.
Consider using declarative registration in your layer.xml file, or delaying
the initialization of the whole subsystem till it is really used.
In case it is necessary to perform the write, you can modify the
'allowed-file-write.txt' file in ide.kit module. More details at
http://wiki.netbeans.org/FitnessViaWhiteAndBlackList
checkWrite: /space/workspace/ergonomics/ide.kit/build/test/qa-functional/work/userdir0/var/cache/dict
java.lang.Exception: checkWrite: /space/workspace/ergonomics/ide.kit/build/test/qa-functional/work/userdir0/var/cache/dict
        at org.netbeans.test.ide.CountingSecurityManager.checkWrite(CountingSecurityManager.java:413)
        at java.io.File.mkdir(File.java:1155)
        at java.io.File.mkdirs(File.java:1184)
        at org.netbeans.modules.spellchecker.TrieDictionary.getDictionary(TrieDictionary.java:224)
        at org.netbeans.modules.spellchecker.DictionaryProviderImpl.createDictionary(DictionaryProviderImpl.java:168)
        at org.netbeans.modules.spellchecker.DictionaryProviderImpl.getDictionary(DictionaryProviderImpl.java:100)
        at org.netbeans.modules.spellchecker.ComponentPeer$9.lookupDictionary(ComponentPeer.java:626)
        at org.netbeans.modules.spellchecker.ComponentPeer.getDictionary(ComponentPeer.java:419)
        at org.netbeans.modules.spellchecker.ComponentPeer.computeHint(ComponentPeer.java:527)
        at org.netbeans.modules.spellchecker.ComponentPeer.access$100(ComponentPeer.java:115)
        at org.netbeans.modules.spellchecker.ComponentPeer$2.run(ComponentPeer.java:154)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1351)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1889)
checkWrite: /space/workspace/ergonomics/ide.kit/build/test/qa-functional/work/userdir0/var/cache/dict/dictionary_en_US.trie1
java.lang.Exception: checkWrite: /space/workspace/ergonomics/ide.kit/build/test/qa-functional/work/userdir0/var/cache/dict/dictionary_en_US.trie1
        at org.netbeans.test.ide.CountingSecurityManager.checkWrite(CountingSecurityManager.java:413)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:169)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at org.netbeans.modules.spellchecker.TrieDictionary.getDictionary(TrieDictionary.java:226)
        at org.netbeans.modules.spellchecker.DictionaryProviderImpl.createDictionary(DictionaryProviderImpl.java:168)
        at org.netbeans.modules.spellchecker.DictionaryProviderImpl.getDictionary(DictionaryProviderImpl.java:100)
        at org.netbeans.modules.spellchecker.ComponentPeer$9.lookupDictionary(ComponentPeer.java:626)
        at org.netbeans.modules.spellchecker.ComponentPeer.getDictionary(ComponentPeer.java:419)
        at org.netbeans.modules.spellchecker.ComponentPeer.computeHint(ComponentPeer.java:527)
        at org.netbeans.modules.spellchecker.ComponentPeer.access$100(ComponentPeer.java:115)
        at org.netbeans.modules.spellchecker.ComponentPeer$2.run(ComponentPeer.java:154)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1351)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1889)
 expected:<0> but was:<2>
        at org.netbeans.test.ide.CountingSecurityManager.assertCounts(CountingSecurityManager.java:154)
        at org.netbeans.test.ide.GeneralSanityTest.testNoWrites(GeneralSanityTest.java:93)
        at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:89)
        at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:345)
        at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:274)
        at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:364)
        at org.netbeans.junit.NbTestCase.run(NbTestCase.java:214)
        at org.netbeans.junit.NbModuleSuite$NbTestSuiteLogCheck.runTest(NbModuleSuite.java:1214)
        at org.netbeans.junit.NbModuleSuite$S.runInRuntimeContainer(NbModuleSuite.java:799)
        at org.netbeans.junit.NbModuleSuite$S.run(NbModuleSuite.java:574)
Comment 4 Jan Jancura 2010-03-08 08:42:19 UTC
fixed in jet-main: http://hg.netbeans.org/jet-main/rev/82ca4d2cea90
Comment 5 Jaroslav Tulach 2010-03-10 02:56:14 UTC
Improved, many classes are gone. Still there is something strange:

o.n.m.spellchecker.bindings.java.JavaSemanticTokenList$FactoryImpl

gets loaded via:

org.openide.util.lookup.MetaInfServicesLookup.search
org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:488)
org.netbeans.modules.java.source.JavaSourceTaskFactoryManager.update(:82)
org.netbeans.modules.java.source.JavaSourceTaskFactoryManager.&lt;init&gt;(:78)
org.netbeans.modules.java.source.JavaSourceTaskFactoryManager.register(:58)
org.netbeans.modules.java.source.JBrowseModule.restored(JBrowseModule.java:79)

I'd like to understand why this is necessary and eliminate that.
Comment 6 Quality Engineering 2010-03-10 23:14:59 UTC
Integrated into 'main-golden', will be available in build *201003110200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/82ca4d2cea90
User: Jan Jancura<jjancura@netbeans.org>
Log: #181184: spellchecker classes loaded on start
Comment 7 Vitezslav Stejskal 2010-03-12 04:57:06 UTC
(In reply to comment #5)
> Improved, many classes are gone. Still there is something strange:
> o.n.m.spellchecker.bindings.java.JavaSemanticTokenList$FactoryImpl

These shouldn't be loaded now - http://hg.netbeans.org/jet-main/rev/ee44a58afe18. I delayed the initialization of java task factories until the java indexer is used for the first time (eg. when scanning the first java sources root). I hope there are not going to be problems with it, otherwise I'm ready to backout the changeset.
Comment 8 Jan Jancura 2010-03-30 13:52:18 UTC
Looks like fixed.