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 204513 - Startup with ergonomics on isn't faster than with ergonomics off
Summary: Startup with ergonomics on isn't faster than with ergonomics off
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Features On Demand (show other bugs)
Version: 7.1
Hardware: PC All
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API_REVIEW_FAST, PERFORMANCE, REGRESSION
Depends on: 210310
Blocks:
  Show dependency tree
 
Reported: 2011-11-01 14:13 UTC by Petr Cyhelsky
Modified: 2012-04-04 10:10 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Startup visualization (554.81 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-11-22 09:33 UTC, Tomas Hurka
Details
Comparing classes loaded on 2nd start (no project) between ergonomics and java edition (32.57 KB, patch)
2011-11-28 08:08 UTC, Jaroslav Tulach
Details | Diff
Persisting modules between restarts (15.33 KB, patch)
2012-01-30 09:56 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cyhelsky 2011-11-01 14:13:08 UTC
Startup with ergonomics enabled should be comparable to the lighter editions (PHP,J2SE) of NB. Currently it startup_time-wise doesn't make much difference whether it is on or off.
Comment 1 Jaroslav Tulach 2011-11-11 13:59:01 UTC
Petře, could you please generate comparition of both starts so we know what part is slower? I have NPS files for both starts, but they are hard to orient in.
Comment 2 Tomas Hurka 2011-11-22 09:33:27 UTC
Created attachment 113403 [details]
Startup visualization

Startup visualization of full, ergonomics and J2SE build on Windows. It is a cold start with opened AnagramGame.
Comment 3 Jaroslav Tulach 2011-11-22 12:04:47 UTC
ergonomics#0feed2ea1ed1
Comment 4 Marian Mirilovic 2011-11-22 14:19:26 UTC
Petr, please verify ... we will backport the fix into release71
Comment 5 Petr Cyhelsky 2011-11-22 16:30:04 UTC
This fix only fixes Issue #205436 but does nothing for this issue
Comment 6 Quality Engineering 2011-11-24 16:02:17 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/0feed2ea1ed1
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #204513: At least 500ms on cold disk has been waisted by initializing the listener on config/Modules directory. Do it in background.
Comment 7 Petr Cyhelsky 2011-11-24 19:03:27 UTC
The changeset from comment #3 is not fix for this bug but for Issue #205436. Jarda is still investigating ways to fix this regression -> removing 71_HR_FIX_CANDIDATE keyword
Comment 8 Quality Engineering 2011-11-25 06:18:04 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/20f312c843ed
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #204513: At least 500ms on cold disk has been waisted by initializing the listener on config/Modules directory. Do it in background.
Comment 9 Jaroslav Tulach 2011-11-28 08:08:54 UTC
Created attachment 113560 [details]
Comparing classes loaded on 2nd start (no project) between ergonomics and java edition

As far as I can tell, the Java edition has been optimized quite a lot. It loads only debugger related classes and few java project/platform related ones. It is hard for ergonomics to be faster (especially when it needs to process three times more modules, in spite they are disabled).
Comment 10 Petr Cyhelsky 2011-11-28 08:29:38 UTC
With recent enhancements in startup and considering the big problem seems to be only with cold startup, not the warm one, priority can be lowered to P3.
Comment 11 Jaroslav Tulach 2011-12-07 18:08:03 UTC
As most of the slowness is caused by processing most of the available (and disabled) modules, I'd like to cache the previous call to enabled(...) and remember the order of modules and their dependencies, so next time I can set up everything without parsing manifests at all.
Comment 12 Jaroslav Tulach 2012-01-30 09:56:36 UTC
Created attachment 115374 [details]
Persisting modules between restarts

I'd like to eliminate parsing of manifests and possibly also computation of module dependencies on subsequent starts. This is the first attempt.
Comment 13 Jesse Glick 2012-01-31 18:37:33 UTC
If you are using ModuleHistory for something again, delete the comment at its head.


Use NbCollections to avoid unchecked warnings as for (Map<File,Module>) mm.readObjectInScope(...).


Beware of package dependencies, which could suddenly fail to be satisfied just because you used a different --jdkhome. Probably need to be explicitly rechecked on each startup even if using cache.


readObjectInScope could take a type parameter for clarity, though it would be called with Object anyway.


Change to signature of SpecificationVersion technically requires API_REVIEW_FAST.
Comment 14 Jaroslav Tulach 2012-03-06 09:41:43 UTC
I am starting new attempt with a test to prevent parsing on start and removal of old manifests cache: http://hg.netbeans.org/ergonomics/rev/CacheModuleState204513
Comment 15 Jaroslav Tulach 2012-03-15 09:16:39 UTC
Here are some measurements as of dd5b0c02d3d3. 

Warm ergonomics start:
Old: Window system shown @3371, @3193, @3220, @3275, @3362 => Avg. of 3 = 3285 ms
New: Window system shown@2966, @3045, @2938, @3002, @2949 => Avg. of 3 = 2972 ms
That would mean about 10% speed up in warm ergonomics start against previous version.

Comparing warm start of new ergonomics vs. new full build without ergonomics:
full: @4271, @4218. @4359, @4440, @4454 => Avg. of 3 = 4356 ms
That means ergonomics are after by 30% than build without ergonomics in this case.

Comparing cold start of ergonomics (8s) vs. cold start of full build (9.6s) does not make thta big difference, yet ergonomics is faster. By 15-20%.

Warm start of Java SE edition is:
@3549, @3479, @3599, @3558, @3526 => Avg of 3 = 3540ms 
this means that on warm start empty ergonomics are 17% faster than Java SE.

Cold start of Java SE was about 8.6s which makes ergonomics slightly (about 5%) faster than SE.
Comment 16 Jaroslav Tulach 2012-03-16 07:25:51 UTC
Almost ready to merge:
http://hg.netbeans.org/ergonomics/rev/879820a7bc7e
Contains compatible friend API change between core.startup and autoupdate.services and ide.ergonomics.

The speedup is achieved by keeping essential Module information in a separate ModuleData class and delaying its initialization as much as possible. In case of empty ergonomics start, only platform, ide, nb, ergonomics and webcommon module manifests are parsed. This is ensured by a test. To achieve that I had to turn php.hudson and remotefs.versioning into recommended autoloads.
Comment 17 Petr Jiricka 2012-03-16 07:52:17 UTC
How about the measurements of the warm ergonomics start with some clusters activated (e.g. java)? To realistically compare ergonomics with the full build without ergonomics and with JavaSE edition, at least some clusters should be activated. In practice noone performs a warm start of ergonomics without any features activated. Thanks.
Comment 18 Jaroslav Tulach 2012-03-18 17:11:04 UTC
Merged as ergonomics#94ac8a6ab650

Re. measurements of ergo+java - yes, it should be measured and Petr C. can probably do it. But what should be the income? Faster than full edition and slower than plain java edition would be my expecation...
Comment 19 Jaroslav Tulach 2012-03-24 20:51:36 UTC
Merged once again as ergonomics#b0118b3609f0 - hopefully it will become part of main now.
Comment 20 Quality Engineering 2012-04-04 10:10:27 UTC
Integrated into 'main-golden', will be available in build *201204040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/94ac8a6ab650
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: Merge of #204513 as it seems relatively stable.