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 127408 - 50 useless classes initialized on startup in CND
Summary: 50 useless classes initialized on startup in CND
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vladimir Kvashin
URL:
Keywords: PERFORMANCE
Depends on: 127492
Blocks: 145199
  Show dependency tree
 
Reported: 2008-02-14 15:53 UTC by Jaroslav Tulach
Modified: 2009-10-22 12:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
My attempt to remove the need for ModuleInstalls (37.25 KB, patch)
2008-02-15 09:44 UTC, Jaroslav Tulach
Details | Diff
Reducing language model classes by 76: details (5.61 KB, text/plain)
2008-03-03 07:33 UTC, Vladimir Kvashin
Details
CND classes in 080825 build (3.52 KB, text/plain)
2008-09-02 11:31 UTC, Alexander Kouznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2008-02-14 15:53:37 UTC
We just did a measurement of the classes loaded by various kits and to our surprise there is quite a lot of them 
originating from CND. Given the fact that most of the users of the full IDE build do use other features more often 
than they use CND, these classes are just laying around occupying permanent space desirably needed for other 
functionality. I'd like the amount of them to be lowered, preferably to zero:

org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl
org.netbeans.modules.cnd.api.compilers.CompilerSetManager
org.netbeans.modules.cnd.api.model.CsmModel
org.netbeans.modules.cnd.api.model.CsmModelAccessor
org.netbeans.modules.cnd.api.model.CsmModelAccessor$CsmModelEx
org.netbeans.modules.cnd.api.model.CsmModelAccessor$1
org.netbeans.modules.cnd.api.model.CsmModelListener
org.netbeans.modules.cnd.api.model.CsmModelState
org.netbeans.modules.cnd.api.model.CsmModelStateListener
org.netbeans.modules.cnd.api.model.CsmProgressListener
org.netbeans.modules.cnd.api.model.util.WeakList
org.netbeans.modules.cnd.api.project.NativeProjectItemsListener
org.netbeans.modules.cnd.apt.debug.APTTraceFlags
org.netbeans.modules.cnd.apt.debug.DebugUtils
org.netbeans.modules.cnd.apt.impl.support.APTDriverImpl
org.netbeans.modules.cnd.apt.support.APTDriver
org.netbeans.modules.cnd.apt.support.APTIncludePathStorage
org.netbeans.modules.cnd.apt.support.APTSystemStorage
org.netbeans.modules.cnd.apt.utils.APTIncludeUtils
org.netbeans.modules.cnd.apt.utils.APTStringManager
org.netbeans.modules.cnd.apt.utils.APTStringManager$APTCompoundStringManager
org.netbeans.modules.cnd.apt.utils.APTStringManager$APTSingleStringManager
org.netbeans.modules.cnd.apt.utils.FilePathCache
org.netbeans.modules.cnd.apt.utils.TextCache
org.netbeans.modules.cnd.apt.utils.WeakSharedSet
org.netbeans.modules.cnd.apt.utils.WeakSharedSet$SharedKeyWeakHashMap
org.netbeans.modules.cnd.apt.utils.WeakSharedSet$SharedKeyWeakHashMap$Entry
org.netbeans.modules.cnd.apt.utils.WeakSharedSet$SharedKeyWeakHashMap$KeySet
org.netbeans.modules.cnd.classview.actions.SelectInClassesAction
org.netbeans.modules.cnd.classview.actions.ShowHideClassViewAction
org.netbeans.modules.cnd.classview.ClassViewInstaller
org.netbeans.modules.cnd.classview.ClassViewInstaller$ProjectListener
org.netbeans.modules.cnd.classview.resources.I18n
org.netbeans.modules.cnd.CndModule
org.netbeans.modules.cnd.debugger.gdb.actions.GdbActionHandlerProvider
org.netbeans.modules.cnd.debugger.gdb.actions.ToggleBreakpointActionProvider
org.netbeans.modules.cnd.debugger.gdb.EditorContext
org.netbeans.modules.cnd.debugger.gdb.EditorContextBridge
org.netbeans.modules.cnd.debugger.gdb.EditorContextImpl
org.netbeans.modules.cnd.debugger.gdb.EditorContextImpl$EditorLookupListener
org.netbeans.modules.cnd.debugger.gdb.GdbDebuggerModule
org.netbeans.modules.cnd.debugger.gdb.profiles.ui.ProfileNodeProvider
org.netbeans.modules.cnd.debugger.gdb.profiles.ui.ProfileNodeProvider$CndProfileGeneralCustomizerNode
org.netbeans.modules.cnd.editor.cplusplus.CCKit
org.netbeans.modules.cnd.editor.cplusplus.CCSettingsInitializer
org.netbeans.modules.cnd.editor.cplusplus.CKit
org.netbeans.modules.cnd.editor.fortran.FKit
org.netbeans.modules.cnd.editor.fortran.FSettingsInitializer
org.netbeans.modules.cnd.editor.makefile.MakefileKit
org.netbeans.modules.cnd.editor.makefile.MakefileSettingsInitializer
org.netbeans.modules.cnd.editor.shell.ShellKit
org.netbeans.modules.cnd.editor.shell.ShellSettingsInitializer
org.netbeans.modules.cnd.gotodeclaration.element.providers.BaseProvider
org.netbeans.modules.cnd.gotodeclaration.element.providers.FuncVarElementProvider
org.netbeans.modules.cnd.gotodeclaration.element.providers.MacroProvider
org.netbeans.modules.cnd.gotodeclaration.element.spi.ElementProvider
org.netbeans.modules.cnd.gotodeclaration.element.ui.GoToElementAction
org.netbeans.modules.cnd.gotodeclaration.element.ui.GoToElementPanel$ContentProvider
org.netbeans.modules.cnd.gotodeclaration.type.CppTypeProvider
org.netbeans.modules.cnd.highlight.CppHighlightsLayerFactory
org.netbeans.modules.cnd.highlight.error.HighlightProvider
org.netbeans.modules.cnd.highlight.error.HighlightProvider$1
org.netbeans.modules.cnd.highlight.error.HighlightProvider$2
org.netbeans.modules.cnd.highlight.HighlightInstaller
org.netbeans.modules.cnd.loaders.AsmDataLoader
org.netbeans.modules.cnd.loaders.CCDataLoader
org.netbeans.modules.cnd.loaders.CDataLoader
org.netbeans.modules.cnd.loaders.CndAbstractDataLoader
org.netbeans.modules.cnd.loaders.CndMIMEResolver
org.netbeans.modules.cnd.loaders.CndSniffyMIMEResolver
org.netbeans.modules.cnd.loaders.ExeLoader
org.netbeans.modules.cnd.loaders.FortranDataLoader
org.netbeans.modules.cnd.loaders.HDataLoader
org.netbeans.modules.cnd.loaders.MakefileDataLoader
org.netbeans.modules.cnd.loaders.ShellDataLoader
org.netbeans.modules.cnd.makeproject.api.actions.BatchBuildAction
org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerNode
org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerRootNodeProvider
org.netbeans.modules.cnd.makeproject.api.CustomProjectActionHandlerProvider
org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler
org.netbeans.modules.cnd.makeproject.MakeProjectModule
org.netbeans.modules.cnd.makeproject.MakeProjectModule$L
org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider
org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider$RunProfileCustomizerNode
org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl
org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl$3
org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue
org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue$Queue
org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue$State
org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread
org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager
org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper
org.netbeans.modules.cnd.modelimpl.csm.core.ProgressSupport
org.netbeans.modules.cnd.modelimpl.debug.TraceFlags
org.netbeans.modules.cnd.modelimpl.Installer
org.netbeans.modules.cnd.modelimpl.Installer$Startupable
org.netbeans.modules.cnd.modelimpl.memory.LowMemoryListener
org.netbeans.modules.cnd.modelimpl.platform.ModelSupport
org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$FileChangeListener
org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$1
org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$1$1
org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$3
org.netbeans.modules.cnd.modelimpl.platform.ProgressListenerImpl
org.netbeans.modules.cnd.modelimpl.repository.RepositoryListenerImpl
org.netbeans.modules.cnd.modelimpl.repository.RepositoryListenerImpl$RepositoryShutdownHook
org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils
org.netbeans.modules.cnd.modelimpl.textcache.FileNameCache
org.netbeans.modules.cnd.modelimpl.textcache.ProjectNameCache
org.netbeans.modules.cnd.modelimpl.textcache.QualifiedNameCache
org.netbeans.modules.cnd.modelimpl.uid.UIDManager
org.netbeans.modules.cnd.navigation.hierarchy.HierarchyAction
org.netbeans.modules.cnd.repository.api.Repository
org.netbeans.modules.cnd.repository.api.RepositoryAccessor
org.netbeans.modules.cnd.repository.api.RepositoryTranslation
org.netbeans.modules.cnd.repository.disk.AbstractDiskRepository
org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager
org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$AllFilter
org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$CloseVisitor
org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$RemovedPersistent
org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$Visitor
org.netbeans.modules.cnd.repository.impl.DelegateRepository
org.netbeans.modules.cnd.repository.impl.HybridRepository
org.netbeans.modules.cnd.repository.queue.BaseQueue
org.netbeans.modules.cnd.repository.queue.BaseQueue$Queue
org.netbeans.modules.cnd.repository.queue.KeyValueQueue
org.netbeans.modules.cnd.repository.queue.RepositoryQueue
org.netbeans.modules.cnd.repository.queue.RepositoryQueue$Filter
org.netbeans.modules.cnd.repository.queue.RepositoryThreadManager
org.netbeans.modules.cnd.repository.queue.RepositoryThreadManager$Wrapper
org.netbeans.modules.cnd.repository.queue.RepositoryWriter
org.netbeans.modules.cnd.repository.queue.RepositoryWritingThread
org.netbeans.modules.cnd.repository.queue.TickingRepositoryQueue
org.netbeans.modules.cnd.repository.spi.Persistent
org.netbeans.modules.cnd.repository.spi.RepositoryListener
org.netbeans.modules.cnd.repository.testbench.Stats
org.netbeans.modules.cnd.repository.translator.RepositoryTranslatorImpl
org.netbeans.modules.cnd.repository.translator.RepositoryTranslatorImpl$UnitsCache
org.netbeans.modules.cnd.repository.util.IntToStringCache
org.netbeans.modules.cnd.repository.util.RepositoryListenersManager
Comment 1 Thomas Preisler 2008-02-15 00:20:53 UTC
Got rid of:
org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerNode
org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerRootNodeProvider
org.netbeans.modules.cnd.makeproject.api.CustomProjectActionHandlerProvider
org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler
org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider
org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider$RunProfileCustomizerNode
Still working on:
org.netbeans.modules.cnd.makeproject.MakeProjectModule$L
org.netbeans.modules.cnd.makeproject.api.actions.BatchBuildAction
I think I need
org.netbeans.modules.cnd.makeproject.MakeProjectModule
so I will keep it for now.
Comment 2 Thomas Preisler 2008-02-15 02:22:53 UTC
Gor rid of:
org.netbeans.modules.cnd.makeproject.MakeProjectModule$L
Left is (in project module):
org.netbeans.modules.cnd.makeproject.api.actions.BatchBuildAction
org.netbeans.modules.cnd.makeproject.MakeProjectModule
which we need.
Comment 3 Jaroslav Tulach 2008-02-15 09:44:18 UTC
Created attachment 56721 [details]
My attempt to remove the need for ModuleInstalls
Comment 4 Jaroslav Tulach 2008-02-15 09:53:33 UTC
Thanks for looking at the problem. I tried it myself too, but without proper guidance I can just prototype - not 
create the right fix. Anyway please look at my patch, I think that at least the CsmLifecycleListener is an interesting 
concept. If you can identify "entry points" to your code, then you can modify them to trigger the initialization of 
the listeners when needed, not on start up. This should be win-win situation - as you do not need to change your code 
that much (ModuleInstall.restored just becomes CsmLifecycleListener.startup) and moreover users not needing the CND 
functionality will not pay any/much unneeded penalty on start up.
Comment 5 _ gordonp 2008-02-15 16:26:17 UTC
I've made a separate issue for gdb and made this issue depend on it.
Comment 6 Thomas Preisler 2008-02-15 17:30:27 UTC
How to re-generate the list of loaded classes? I guess you start the IDE with no projects loaded and then what?
Comment 7 Jaroslav Tulach 2008-02-15 20:03:02 UTC
To regenerate the classes: Part of my diff attached here is modification of blacklist.txt and some xtest file enabling 
the xtest to track the classes. Feel free to apply it and even integrate blacklist.txt with classes that you remove. 
That way we will make sure your fixes do not regress in future.

There is other way to generate the list: Start netbeans with -J-verbose:class

Comment 8 Thomas Preisler 2008-02-16 01:47:26 UTC
got rid of:
org.netbeans.modules.cnd.makeproject.MakeProjectModule
Comment 9 Vladimir Kvashin 2008-03-03 07:32:27 UTC
Reduced number of classes related to language model by 76
(see details in the attachment)
Comment 10 Vladimir Kvashin 2008-03-03 07:33:59 UTC
Created attachment 57636 [details]
Reducing language model classes by 76: details
Comment 11 Vladimir Kvashin 2008-03-04 07:44:46 UTC
The number of CND classes loaded at startup is reduced more than twice.

A lot of class loads can't be eliminated (data loaders, global actions, classes that are responsible for activating the
model when CND projects are loaded, etc)

Nevertheless there still is a room for improvement.
Therefore I'm not closing the issue, but just downgrading it to P3.

Comment 12 Vladimir Voskresensky 2008-09-02 10:11:06 UTC
data loaders were eliminated as well
I think, now we have only necessary classes to be loaded
Comment 13 Jaroslav Tulach 2008-09-02 10:50:25 UTC
Alexander, can you please update the whitelist and count the number of classes that come from CND? Just doing 

$ grep cnd ~/src/netbeans/fixes/ide.kit/test/qa-functional/data/whitelist.txt | wc -l

still yields 144, which seems a bit too much to be true (at least I hope).
Comment 14 Alexander Kouznetsov 2008-09-02 11:30:04 UTC
List of loaded classes of last whitelist test run on Windows XP (080825) has 60 cnd classes. Should I remove other 84
cnd classes from whitelist?
Comment 15 Alexander Kouznetsov 2008-09-02 11:31:08 UTC
Created attachment 68854 [details]
CND classes in 080825 build
Comment 16 Jaroslav Tulach 2008-09-02 12:01:43 UTC
Yes, Alexander, please remove the classes which are no longer loaded from whitelist.

Anyway, I think there is still plenty of room for improvement. I see no reason to load anything that relates to model 
until at least one C/C++ project is created. Please continue in your fixing effort.
Comment 17 Vladimir Voskresensky 2008-09-02 12:57:38 UTC
thanks for the list (I'm changing summary). We will investigate it later
Comment 18 Alexander Kouznetsov 2008-09-02 13:38:58 UTC
Does this mean that 10 classes are useful? ;-)
Comment 19 Vladimir Voskresensky 2008-09-02 13:49:32 UTC
I think, yes :-)
We need some infrastructure to be registered to track start of C++ activity
Comment 20 Vladimir Voskresensky 2009-03-14 19:55:46 UTC
Jaroslav,
Is it still a valid issue?
Comment 21 nnnnnk 2009-10-22 12:11:18 UTC
fixed