Bug 18239 - Startup takes too long with java editor open
Summary: Startup takes too long with java editor open
Status: RESOLVED WONTFIX
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.1 M5   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2002-05-29 16:08 EDT by Kevin Haaland CLA
Modified: 2003-01-17 08:51 EST (History)
2 users (show)

See Also:


Attachments
Here is the stack dump (19.72 KB, text/plain)
2002-05-30 18:14 EDT, Kevin Haaland CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Haaland CLA 2002-05-29 16:08:37 EDT
Peter has another case of extremely long startup times using the F1 build. It 
appears to be very similiar to his previous case. ie. Opening with a java 
editor selected is slow but if you then exit with a .txt file opening the 
starup times get much better.

Here are the steps:

   -> He had a similiar workspace, lots of projects with external references
   -> Saved workspace had Java Perspective Open, multiple files in editor area
      the active editor was a .java file. 
          [His initial state was more involved but we simplified it to this]

   Time to startup 90 seconds

   -> Create a .txt file. Have it selected. Exit and restart

   Time to startup 23 seconds

   -> Close the .txt editor (which would cause the previously open java editor 
      to become active)

   Time to open the java editor ~90 seconds

We tried to get profile inforamation from j9 and failed. The best we could do 
was a stack dump of what the threads were doing and it looked like a reconciler 
(MonoReconciler) was running? 

We also tried the same case using today's build 0529 and it is still slow. 


Other variations:

   We tried making the Resource perspective active (same editors as the slow 
case) and it got even slower. 

    Time to startup 184 seconds
Comment 1 Kai-Uwe Maetzel CLA 2002-05-29 16:36:48 EDT
MonoReconciler running is OK. It does so in a separate thread and should not 
prevent the editor from coming up. Profiling information would help to see 
whether the two threads *UI, MomoReconciler) block each other.
Comment 2 Erich Gamma CLA 2002-05-30 16:44:44 EDT
is there any way this workspace could be ftp-ed to us so that we can analyze 
the trace?
Comment 3 Peter Burka CLA 2002-05-30 17:01:50 EDT
Yes, but it's VERY big. (~1GB including required support files).

Kevin and I are going to try to profile it here, first.
Comment 4 Kevin Haaland CLA 2002-05-30 18:14:00 EDT
Created attachment 1128 [details]
Here is the stack dump
Comment 5 Kevin Haaland CLA 2002-05-30 18:14:33 EDT
Got it. See attachment for details. The time is spent creating the outline view 
contents. 

Using the same setup as before but this time deleting the outline view the time 
to open the editor 
Comment 6 Erich Gamma CLA 2002-05-31 13:02:52 EDT
added the annotation to the wrong bug...
====
I wonder whether the override indicator is the problem.
Can you run the scenario again but with the override indicator turned off:
Preferences>Java>Appearance: Show Override Indicator in outline and hierarchy
Comment 7 Peter Burka CLA 2002-05-31 13:40:43 EDT
Changing the Show Override Indicator setting had no effect on the startup 
times.

I also tried changing the scenario so that the Outline was open on Object at 
startup, since this is a much simpler class. This actually made startup even 
slower (>250sec).
Comment 8 Erich Gamma CLA 2002-06-02 16:25:30 EDT
This might be asking for a lot, but what would really help us the most is an 
Optimize perf trace of the start-up time. Can you produce this and export as 
html? Otherwise we have to do the workspace ftp-transfer.

Just as a data point: our current start-up time in a self hosting workspace 
with one Java file is 40s (-6s from previous builds). 
Comment 9 Erich Gamma CLA 2002-06-05 19:07:50 EDT
The trace shows that the UI thread is waiting on the JavaModelManager lock that 
is held by a reconciler thread. Closing the outline view makes the problem go 
away since then the UI thread will not request for the element info that makes 
it wait for the lock.

The problem seems to be that the JavaModelManager lock is kept for an extended 
period of time. Philippe do you see a way to shorten the time that this lock is 
held. 

Moving to JDT Core for investigation.
Comment 10 Philipe Mulet CLA 2002-06-06 04:51:33 EDT
Indeed the lock on the project element creation comprises the namelookup 
initialization (need to find all package fragment roots + all package 
fragments).

Comment 11 Philipe Mulet CLA 2002-06-06 04:52:17 EDT
Changing the concurrency characteristics at this stage is likely asking for 
trouble elsewhere... need to be really careful.
Comment 12 Philipe Mulet CLA 2002-06-06 11:00:34 EDT
David - pls gather some profiling stats using reasonable workspace (tried on a 
large on, and had to kill it after an hour waiting for it to show up).
Comment 13 Philipe Mulet CLA 2002-06-10 09:41:15 EDT
The stack dump only exposes the fact that 2 identical namelookups are being 
created concurrently. This is causing some competion on locks. We changed the 
implementation so as to avoid 2 concurrent creations of the same namelookup, 
but the timing won't look much different, in so far as one will wait idle while 
the namelookup is ready to use.

So the characteristics will be pretty much the same.
Comment 14 David Audel CLA 2002-06-12 11:09:56 EDT
I can not reproduce the long startup.

If the last build did not improve the startup time, could you ftp-ed to us your 
very very huge workspace. 
Comment 15 Philipe Mulet CLA 2003-01-17 08:51:17 EST
Closing as not reproduceable. Also various changes occurred to reduce our 
startup time (no longer checking index consistency).