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 41084 - Folder expansion is sometimes slower with new build system
Summary: Folder expansion is sometimes slower with new build system
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE, REGRESSION
Depends on: 41118
Blocks: 41535
  Show dependency tree
 
Reported: 2004-03-17 16:53 UTC by Antonin Nebuzelsky
Modified: 2007-09-26 09:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot from OptimizeIt (78.03 KB, image/jpeg)
2004-07-28 18:19 UTC, Tomas Zezula
Details
Next screenshot from OptimizeIt (197.99 KB, image/jpeg)
2004-07-28 18:20 UTC, Tomas Zezula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-03-17 16:53:50 UTC
BuildSys team has done a good job in eliminating
the huge folder expansion regression, but there is
still something strange in the code. Sometimes
measurement shows me significantly longer time,
while in other cases it shows good time. The
problem manifests itself on linux (see the numbers
below...).

Here are results from testing on W2K (Dell
Precision 220, PIII 800MHz, 512MB RAM, Windows
2000) and Linux (Dell Latitude C840, PIV 2.2GHz,
1024MB RAM, Red Hat 9). Each test was repeated
several times.

Expanding a folder containing 1000 very simple
java files:

W2K:
200403141900 - 5172ms, 5703ms, 5235ms
200403161900 - 5297ms, 5250ms, 5266ms

Linux:
200403141900 - 4179ms, 3127ms, 3493ms
200403161900 - 9863ms, 4465ms, 17131ms, 4933ms,
               15059ms, 4125ms
Comment 1 Antonin Nebuzelsky 2004-05-27 12:53:45 UTC
Tomasi, I've done measurements with today's trunk and expanding folder
with 1000 javas is still problematic on linux. I've done 10
measurements on W2K and on Linux. Linux still shows a strange long
time sometimes.

W2K:
200405271200 (my build) - 5016ms, 5000ms, 5000ms, 4985ms, 5000ms,
5000ms, 5000ms, 5015ms, 5031ms, 5016ms

Linux:
200405271200 (my build) - 3413ms, 9235ms, 4227ms, 4227ms, 4760ms,
4557ms, 4704ms, 9306ms, 9124ms, 4230ms

This is hard to track in profiler because the CPU profiling makes the
times much longer and you'd need many profiling snapshots to compare,
find out which of them are the worse cases and compare with the better
ones to find differences. But eventually this will perhaps be the only
way to find the cause.
Comment 2 Tomas Zezula 2004-07-28 18:14:44 UTC
Tondo, can you remeasure it again.
On my Linux workstation (Intel(R) Pentium(R) M processor 1600MHz,
Linux 2.6.5-7.95)it works fine, the folder with 1000 files opens in 3s.
Here are some screenshots of active threads in OptimizeIt.
Comment 3 Tomas Zezula 2004-07-28 18:19:37 UTC
Created attachment 16531 [details]
Screenshot from OptimizeIt
Comment 4 Tomas Zezula 2004-07-28 18:20:32 UTC
Created attachment 16532 [details]
Next screenshot from OptimizeIt
Comment 5 Tomas Zezula 2004-07-28 18:23:37 UTC
Please do a new measurement.
Comment 6 Antonin Nebuzelsky 2004-07-29 14:48:26 UTC
The new measurement. The same configuration, with jdk 1.4.2_04.

W2K:
200407281800 - 6094ms, 7344ms, 7391ms, 5437ms, 7656ms, 7212ms

Linux:
200407281800 - 2496ms, 2424ms, 2482ms, 2538ms, 2367ms, 2517ms
Comment 7 Jesse Glick 2004-08-10 05:01:05 UTC
Passing back to Tomas for evaluation.
Comment 8 Tomas Zezula 2004-08-16 10:41:13 UTC
OK, it seems that the problems is on Windows.
Comment 9 _ rkubacki 2004-08-26 14:13:54 UTC
Couple of comments.

Other DataLoaders - we have slow ImageDataLoader (issue #47926) and
also other loaders can perform their work. We may consider more
explicit ordering of loader to move JavaDataLoader to the begining of
the chain as it is primarily JavaIDE. Mainly we would like to avoid
getMIMEType call during recognition that is done for most of XML DOs.

Filesystems 
 * MFS adds a layer to original local FS, 
 * getPath() is slow (called often for example from getAttribute()) I
tried to cache path for last folder. It is not very effective during
startup but later the hit ratio improves to something like 1:15 but
still not very good.

JavaDataObject initialization. The most of time is spent in
addCookieSet. At least I suggest to move it before propert change lsnr
adding to reduce overhead when DO fire change of COOKIE_SET property.
Comment 10 _ rkubacki 2004-08-26 15:10:17 UTC
And yet another comment: 

If there are many Java file the JavaNodes are created and schedule
icon resolving that can be executed before painting of nodes or at
least will cause heavy CPU utilization to complete icon badging.

Some hot places here:
JavaNode$IconResolver.run -> FileBuiltQuery.getStatus that spents a
lot of time in adding linsteners

JMManager.getResource followed by getPackageName in
JavaNode.resolveIcons and hasMain in the same method
Comment 11 Tomas Zezula 2004-09-02 10:27:56 UTC
Radim already fixed the solvable Java related issues. Now the
DataLoaders and FileSystems issues should be fixed.
Reassigning to David
Comment 12 Tomas Zezula 2004-09-02 10:31:32 UTC
I am going to look to FileBuildQuery related issues.
Comment 13 David Konecny 2004-09-02 13:38:34 UTC
If JavaDataLoader should move up in the chain of loaders then it is up
to Java module to do that. The same answer is for JDO initialization.

Passing to Radek to comment FS part.
Comment 14 David Konecny 2004-09-02 13:40:29 UTC
Tonda, just for comparison what is the speed of opening folder with
1000 text files or 1000 html files?
Comment 15 rmatous 2004-09-02 13:55:52 UTC
We discussed all the mentioned filesystems comments  lately and didn't
find any resonable solution. Radim, file a task if you think that
caching path is worth of implementing and I'm ready to fix it ASAP. 
Comment 16 Marian Mirilovic 2004-09-02 14:08:23 UTC
Results from automated tests
[nb_dev](200409011800),[jdk1.5.0](b63)

Hosts:  	RH Linux 9  	JDS 2  	Solaris 9  	Win 2000  	Win XP

  Expand folder with 50 java files
1st usage 	701 	751 	904 	562 	635
2nd usage 	391 	390 	348 	292 	289
  Expand folder with 100 java files
1st usage 	582 	1111 	624 	463 	479
2nd usage 	390 	387 	361 	290 	297
  Expand folder with 100 txt files
1st usage 	564 	517 	536 	364 	416
2nd usage 	415 	406 	335 	339 	295
  Expand folder with 100 xml files
1st usage 	1897 	1859 	2247 	1859 	1646
2nd usage 	382 	552 	722 	275 	287

Explanation :
- test of folder with 50 java files runs before test of folder with
100 java files, so in the time expansion is measured class loading
(for action not for expansion)
- java files expansion is measured with badging turned off 
(perf.dont.resolve.java.badges=true)


Conclusion:
I think folder with java files expansion meets UI criteria, but folder
with 100 xml files expansion doesn't.
Comment 17 Tomas Zezula 2004-09-02 14:29:04 UTC
The only way how to improve the JavaDataObject is to change the
datasystems API (allow to register lookup rather than the CookieSet).
Java module can not do anything with this.
Moving the java datatype up does not help much.
Comment 18 Tomas Zezula 2004-09-02 14:31:45 UTC
I have to disagree with David, JDO initialization is a issue of
DataSystems and must be solved there.
Comment 19 David Konecny 2004-09-02 15:02:00 UTC
Sure, DS is source of lot of problems. But I do not dare to change
anything in DS for Beta2.

Passing back to Tomas who said that there is one more thing he might
improve. After that I suggest to close this issue as fixed. As Marian
said it meets the UI criteria.
Comment 20 Tomas Zezula 2004-09-02 15:26:29 UTC
I've filled an enhancement for data systems:
http://www.netbeans.org/issues/show_bug.cgi?id=48381

There are no more easy to fix solutions for this bug.
We improved the hasMain and JavaDataObject performance.

I've looked into FileBuiltQuery, but deferring adding of listeners in
the StatusImpl from constructor to isBuilt will not help, since
isBuilt is called when resolving icon badges.

To make comparison to 3.6 the cross compilation (on NB 3.6) should be
turned on.
Comment 21 Jesse Glick 2004-09-02 16:01:10 UTC
As mentioned in issue #48381, I disagree with Tomas that "The only way
how to improve the JavaDataObject is to change the datasystems API
(allow to register lookup rather than the CookieSet). Java module
cannot do anything with this." - JavaDataObject could override
getCookie to manage its cookie handling quite explicitly, which could
minimize initialization costs as well as reduce memory consumption per
JDO.
Comment 22 Tomas Zezula 2004-09-02 16:13:13 UTC
OK, I will try this. It may help a bit.