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 71357 - Slow FileChooser when adding J2SE platform
Summary: Slow FileChooser when adding J2SE platform
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-01-13 11:46 UTC by _ rkubacki
Modified: 2008-01-29 18:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
typical stack trace (9.47 KB, text/plain)
2006-01-13 11:48 UTC, _ rkubacki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2006-01-13 11:46:30 UTC
Linux (both i386/FC3 and amd64/FC4), JDK 1.6.0_b66, NB trunk from Jan 12

When adding J2SE platform the file chooser can be extremely slow. I have
/usr/local/home configured as a mount point to a home server (NFS) and
displaying of /usr/local folder in filechooser takes several (>5) seconds. 

During this time I see heavy network activity and the thread dumps shows that
java.io.UnixFileSystem.getBooleanAttributes0(Native Method) is called. This
method calls stat on a file. I am not sure how many calls we do here and wha
files are searched but this can be found with strace.
Comment 1 _ rkubacki 2006-01-13 11:48:04 UTC
Created attachment 28380 [details]
typical stack trace
Comment 2 Jan Lahoda 2006-01-13 12:05:13 UTC
org.netbeans.modules.java.j2seplatform.J2SEInstallImpl does
f.getFileObject("bin").getFileObject("java") for a given folder. Not sure if
this is fast or slow.
Comment 3 Tomas Zezula 2006-01-13 12:18:54 UTC
The J2SEPlatformInstall detects if the folder contains JDK by:
FileObject bin = f.getFileObject("bin");
if (f == null) return false;
return bin.getFileObject("java") != null;
It does some network ops on the NFS, but it should be 2 ops per folder.
Comment 4 Jesse Glick 2006-01-13 18:33:02 UTC
The quoted code is surely more than 2 file ops per folder. If you care about
speed, use java.io.File, not FileObject.
Comment 5 Tomas Zezula 2007-02-15 15:08:12 UTC
OK, the only thing I can do is to rewrite it to use File rather than FileObject.
But I am not sure if it helps. Probably WANTFIX.
Comment 6 Tomas Zezula 2008-01-29 18:34:42 UTC
Radek improved speed of filesystems in NB 6.1, there is no reason to rewrite it to use java.io.File.