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 159810

Summary: Reduce class loading overhead when Hudson is unused
Product: connecteddeveloper Reporter: Jesse Glick <jglick>
Component: HudsonAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker CC: mkleint
Priority: P3 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 161286    
Bug Blocks:    

Description Jesse Glick 2009-03-06 16:06:56 UTC
Currently, even if you do not use Hudson at all, the Hudson modules load too many classes during startup and opening a
project. Last checked (inner classes excluded):

org.netbeans.modules.hudson.api.HudsonChangeListener
org.netbeans.modules.hudson.api.HudsonInstance
org.netbeans.modules.hudson.api.HudsonManager
org.netbeans.modules.hudson.impl.HudsonInstanceImpl
org.netbeans.modules.hudson.impl.HudsonInstanceProperties
org.netbeans.modules.hudson.impl.HudsonManagerImpl
org.netbeans.modules.hudson.impl.MetadataProjectHudsonProvider
org.netbeans.modules.hudson.impl.ProjectHIP
org.netbeans.modules.hudson.maven.HudsonProviderImpl
org.netbeans.modules.hudson.spi.ProjectHudsonProvider
org.netbeans.modules.hudson.ui.actions.AddInstanceAction
org.netbeans.modules.hudson.ui.interfaces.OpenableInBrowser
org.netbeans.modules.hudson.ui.nodes.HudsonRootNode
org.netbeans.modules.hudson.ui.nodes.TooltipNode
org.netbeans.modules.hudson.ui.wizard.InstanceWizard

Impossible to eliminate _all_ classes because the module does need to know:

- if some open projects have associated CI information (ProjectHudsonProvider impls)

- whether there are any servers configured in preferences

But certainly InstanceWizard etc. are unnecessary.
Comment 1 Jesse Glick 2009-04-03 20:54:11 UTC
Better; down to

org.netbeans.modules.hudson.Installer
org.netbeans.modules.hudson.Installer$1
org.netbeans.modules.hudson.api.HudsonInstance
org.netbeans.modules.hudson.api.HudsonManager
org.netbeans.modules.hudson.impl.HudsonInstanceProperties
org.netbeans.modules.hudson.impl.HudsonManagerImpl
org.netbeans.modules.hudson.impl.HudsonManagerImpl$1
org.netbeans.modules.hudson.impl.HudsonManagerImpl$3
org.netbeans.modules.hudson.impl.ProjectHIP
org.netbeans.modules.hudson.impl.RemoteFileSystem$Mapper
Comment 2 Jesse Glick 2009-04-03 20:56:45 UTC
Or rather, after opening a j2seproject:

org.netbeans.modules.hudson.Installer
org.netbeans.modules.hudson.Installer$1
org.netbeans.modules.hudson.api.HudsonInstance
org.netbeans.modules.hudson.api.HudsonManager
org.netbeans.modules.hudson.impl.HudsonInstanceProperties
org.netbeans.modules.hudson.impl.HudsonManagerImpl
org.netbeans.modules.hudson.impl.HudsonManagerImpl$1
org.netbeans.modules.hudson.impl.HudsonManagerImpl$1$1
org.netbeans.modules.hudson.impl.HudsonManagerImpl$3
org.netbeans.modules.hudson.impl.MetadataProjectHudsonProvider
org.netbeans.modules.hudson.impl.ProjectHIP
org.netbeans.modules.hudson.impl.RemoteFileSystem$Mapper
org.netbeans.modules.hudson.maven.HudsonProviderImpl
org.netbeans.modules.hudson.spi.ProjectHudsonProvider
org.netbeans.modules.hudson.spi.ProjectHudsonProvider$1
Comment 3 Jesse Glick 2009-04-03 21:18:13 UTC
Can check at startup whether there are any servers configured, and if not, turn off the rest. Reduces unused overhead to

org.netbeans.modules.hudson.Installer
org.netbeans.modules.hudson.impl.RemoteFileSystem$Mapper

which are both small classes.

Also when a Maven project is opened:

org.netbeans.modules.hudson.maven.HpiActionGoalProvider
org.netbeans.modules.hudson.maven.HpiActionGoalProvider$1

potentially correctable if the Maven module offered a declarative registration for ActionGoalProvider's based on
packaging (this is sensitive to 'hpi').

Projects with associated Hudson builders will not cause e.g. broken build notifications to appear automatically if you
have no persisted Hudson instances. If you expand the Hudson Builders node, the associated builder will be displayed and
everything will be activated at that time.

cdev #c2398a2a2584
Comment 4 Quality Engineering 2009-04-05 07:38:47 UTC
Integrated into 'main-golden', will be available in build *200904050200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c2398a2a2584
User: Jesse Glick <jglick@netbeans.org>
Log: #159810: avoid loading Hudson module classes unless the user has actually registered some servers.