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 21847 - Adding a loader for module is far from scallable.
Summary: Adding a loader for module is far from scallable.
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2002-03-25 09:53 UTC by Petr Nejedly
Modified: 2008-12-23 13:45 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
200 simple testing modules, each adding one loader. (542.45 KB, application/octet-stream)
2002-03-25 09:57 UTC, Petr Nejedly
Details
Binary patch JAR for r33; place in lib/patches/ and restart (41.97 KB, application/octet-stream)
2002-04-02 10:36 UTC, Jesse Glick
Details
Source patch for release33 sources (4.47 KB, patch)
2002-04-02 10:39 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2002-03-25 09:53:12 UTC
Loaders found in module's manifests are added separatelly and each such addition
causes fires resort() which is O(N^2), so that the addition of M loaders
is about O(M^3).
During the startup, the module system should gather all the loaders
and add them all at once to the loader pool, reducing the complexity to O(M^2).
Comment 1 Petr Nejedly 2002-03-25 09:57:51 UTC
Created attachment 5168 [details]
200 simple testing modules, each adding one loader.
Comment 2 Petr Nejedly 2002-03-25 13:56:41 UTC
I tested to run the IDE with the testing modules only and it took
about 70s to startup. When I commented out the call to resort()
in LoaderPolNode.java, it started in ~17s
Standard NB is sped up by about 400ms by not calling resort()
during adding the modules, so calling it only once during the startup
would give us about 300-350ms.
Comment 3 Jan Zajicek 2002-03-25 15:01:08 UTC
E.g. in FFJ EE is startup about 1s faster without calling resort().
Comment 4 Jesse Glick 2002-03-26 08:13:59 UTC
Thanks for finding this - shouldn't be too hard to fix, I think.
Comment 5 Petr Nejedly 2002-03-26 08:33:41 UTC
Actually, Andrew found it.
Do you think the patch will be simple enough to go to 3.3.2?
I don't myself think this should go in, but J.Grodnik has asked.
Comment 6 Jesse Glick 2002-04-02 10:36:26 UTC
Created attachment 5256 [details]
Binary patch JAR for r33; place in lib/patches/ and restart
Comment 7 Jesse Glick 2002-04-02 10:39:03 UTC
Created attachment 5257 [details]
Source patch for release33 sources
Comment 8 Jesse Glick 2002-04-02 10:45:08 UTC
Fixed in the trunk:

committed   * Up-To-Date  1.58       
core/src/org/netbeans/core/LoaderPoolNode.java
committed   * Up-To-Date  1.30       
core/src/org/netbeans/core/modules/NbInstaller.java
Comment 9 Jesse Glick 2002-04-02 10:59:46 UTC
I have made a source patch (should work against release33 sources) and
a binary patch (from the source patch, should work in release33-based
builds).

It does indeed seem to help startup time in EE. Testing methodology:

- using FFJ EE Orion EA (from CD installer)

- machine: PIII/500 256Mb Linux 2.2.12; JDK 1.3.1_02; light load -
other running apps: X (Gnome, Enlightenment) + FSF Emacs

- script-based test sequence from shell:

-- begin with fresh user dir

-- 4 primer runs (each once with binary patch, then once without
patch) to ensure disk files are swapped in and to stabilize the system

-- 10 measured runs (again, alternating patch then no patch)

- using -J-Dnetbeans.close=true and measuring elapsed time

- mean with patch: 35.3 sec (standard deviation 0.26 sec on 10 samples)

- without: 34.3 sec (s.d. 0.23 sec)

- difference: .994 sec or about 2.8%

The performance improvement I saw was four standard deviations, which
is significant.

My personal recommendation is to try to get this in 3.3.2 on the
grounds that (1) a one-second startup time improvement is quite a lot
as these things go, (2) the patch is rather simple.

I would appreciate a code review (Petr or anyone else in core team)
and a QA sanity-check.
Comment 10 Petr Nejedly 2002-04-02 11:54:15 UTC
The patch is OK as far as I understand the module system.

To your results: I guess you've interchanged with/without results,
otherwise I'll be strongly against the patch :-)
Comment 11 Jesse Glick 2002-04-03 18:08:38 UTC
Yes, I'm sorry - each run was w/o patch first then w/ patch. I got it
backwards.
Comment 12 Jesse Glick 2002-04-04 23:13:17 UTC
Now in orion_fcs too:

Checking in src/org/netbeans/core/LoaderPoolNode.java;
/cvs/core/src/org/netbeans/core/LoaderPoolNode.java,v  <-- 
LoaderPoolNode.java
new revision: 1.51.14.3.4.2; previous revision: 1.51.14.3.4.1
done
Processing log script arguments...
More commits to come...
Checking in src/org/netbeans/core/modules/NbInstaller.java;
/cvs/core/src/org/netbeans/core/modules/NbInstaller.java,v  <-- 
NbInstaller.java
new revision: 1.20.14.1.4.1; previous revision: 1.20.14.1
done
Comment 13 Jan Zajicek 2002-04-09 14:11:36 UTC
verified for trunk and 020408_1
Comment 14 Quality Engineering 2003-07-01 16:19:09 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.