Bug 22049

Summary: Hierarchy View slow to calculate hierarchy [type hierarchy]
Product: [Eclipse Project] JDT Reporter: Randy Hudson <hudsonr>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 2.0Keywords: performance
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
opening type hierarchy none

Description Randy Hudson CLA 2002-07-30 14:01:51 EDT
Is the Java Model thread-safe?  If so, maybe the hierarchy view could populate 
itself on a background thread.  Currently F4 takes between 6 and 10 seconds on 
my machine (preferences set to open the hierarchy perpsective).  This is 
roughly the same delay we would experience in the Open Type dialog.  I'm not 
sure what the breakdown is, but I guess that the hierarchy calculation is 
significant.
Comment 1 Dirk Baeumer CLA 2002-07-31 04:26:22 EDT
We did some performance improvements for 2.0 for the type hierarchy. Randy, can 
you provide some information regarding our machine. On my machine (P4 1.6 GHZ) 
opening the type hierarchy on Action (which is quite big) takes 6 seconds. A 
normal type hierarchy is 1 to 2 seconds.
Comment 2 Randy Hudson CLA 2002-07-31 10:02:16 EDT
On my machine (P3 1.13 GHz, 1024MB RAM), this operation takes roughly 10 
seconds.  I might have a few more classes loaded than you.  I have more classes 
in my workspace than you do.

Here is an interesting benchmark.  Close the hierarchy View in the hierarchy 
perspective, then reopen it.  For me this is clearly 90% of the delay in 
bringing up the Hierarchy Perspective.

I like to work in multiple WorkbenchWindows (like VA-Java).  One reason I use 
F4 is that it is the only way to open a new window, not necessarily because I 
need to see a hierarchy immediately.  Making this a background thread would 
really improve the percieved responsiveness.
Comment 3 Adam Kiezun CLA 2002-12-11 10:19:39 EST
Created attachment 2750 [details]
opening type hierarchy

91% of the time needed to open TH on Action is spent in jCore
moving there for comment
Comment 4 Philipe Mulet CLA 2003-01-07 08:17:46 EST
Hierarchies are dynamically computed when needed (unlike VAJava were the built 
state was all in memory and used to produce hierarchies).

In Eclipse, you can get hierarchies independantly from having built your 
sources. Some caching strategy could be investigated to save some time though.
Comment 5 Philipe Mulet CLA 2003-01-28 10:07:41 EST
Some API got added to persist/restore type hierarchies.
Comment 6 Philipe Mulet CLA 2003-01-28 10:08:10 EST
Added APIs to save/restore type hierarchies. Note that the client still has to 
register as a ITypeHierarchyChangedListener once restoration has occurred. 

ITypeHierarchy.store(OutputStream, IProgressMonitor) for saving a type 
hierarchy. 

IType.load(InputStream, IProgressMonitor) for restoring a previously saved 
hierarchy. 
Comment 7 David Audel CLA 2003-02-07 05:12:29 EST
Verified.