Bug 10378 - perf problem with external JARs
Summary: perf problem with external JARs
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-27 05:13 EST by Philipe Mulet CLA
Modified: 2002-02-28 07:08 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2002-02-27 05:13:38 EST
we installed eclipse on a network drive. to start eclipse we also have a
batch-file which sets the workspace directory to a subdirectory on the users
home network drive.

the jdk1.4 is also installed on the global network drive and the eclipse
batch uses the "-vm" option to use this network jdk.

now it is possible to log in on every workstation and work with eclipse. you
always have your own workspace directory. another big advantage is that i
can backup every persons workspace directory every night.

to support external libraries we have a classpath variable named "LIB_HOME"
which also points to a network directory in which we have external
libraries. so we can version projects and work at home as long as you
replicate the LIB_HOME directory from time to time.

everythin works, everythin would be fine, but:

we have a performance problem. i used a network sniffer and realized that a
simple mouseclick in my packagetree lead to a SMB network call to our
samba-server to load some external libraries. i set "-vmargs -Xnoclassgc" in
our batch file so that the java vm won't gc the classes. i thought that
after some working there would be no need to reload the jars again and
again.

but it is not so. they are loaded very very often. again and again.

another interesting point is the "show referenced libraries" menu entry. by
toggling this entry you see that a single library is loaded very often. it
seems it is loaded for every project it is referenced. and i think every
required project is also traversed.

perhaps i'm wrong but in my case i have one project "Tomcat401" which
references all tomcat 401 libraries (jar's). every other project which is a
webapp simply has this project in its dependencies because i need the TC
classes at runtime (not at compile time).

when i set the "show referenced libraries" to "true", the sniffer shows that
every jar is loaded about 3-5 times or more. and the project has 25 JAR's!!!
Comment 1 Philipe Mulet CLA 2002-02-27 05:14:38 EST
We need to investigate our story here.

I am suspecting that each shared JAR is opened quite a number of times (once 
per reference). This sounds true for both the builder and the JavaModel.
In the case of the JavaModel, it might be possible to improve this given we 
share elements underneath. On the builder front, I don't see how we could 
improve this given we have no hook into the build manager, just on project 
build operations.

Maybe we could setup a cache in the JavaModel manager and use a POST_BUILD 
delta notification to clear this cache ?
Comment 2 Philipe Mulet CLA 2002-02-27 05:45:36 EST
Interesting comment in the same area (http://bugs.eclipse.org/bugs/show_bug.cgi?
id=10216). 
Comment 3 Jerome Lanneluc CLA 2002-02-28 06:58:16 EST
Now caching the existence check result on external jars.
This cache is flushed before building, so that the builder can discover that 
some external jars have been deleted.
Comment 4 Jerome Lanneluc CLA 2002-02-28 07:08:30 EST
Fixed external jar existence check problem. See bug 10216 for other performance 
problems.