Bug 27555

Summary: [startup] PackageFragmentRoot - source attached too early (?)
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: performance
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
attachSource on first expansion of a java project
none
attachSource on first switch to java none

Description Adam Kiezun CLA 2002-12-03 05:43:18 EST
20021127
PackageFragmentRoot calls attachSource on openWhenClosed
which happens in the following scenario:

1. 'collapse all' in package explorer
2. restart eclipse
3. expand one project (i tried a source project - probably true for any)
4. you wait a long time and 40% of that time is spent on attaching source to a 
binary file that you have not touched yet

will attach profile
Comment 1 Adam Kiezun CLA 2002-12-03 05:47:24 EST
Created attachment 2620 [details]
attachSource on first expansion of a java project
Comment 2 Adam Kiezun CLA 2002-12-03 09:15:07 EST
Created attachment 2623 [details]
attachSource on first switch to java

the same thing is responsible for 19% of time need to switch to java
perspective the frist time
Comment 3 Jerome Lanneluc CLA 2002-12-06 05:31:18 EST
I even think that the guilty code is earlier: 
JavaProjectElementInfo.computeNonJavaResources() calls 
JavaProject.findPackageFragment0() which forces the opening of all package 
fragment roots of the project.
Comment 4 Jerome Lanneluc CLA 2002-12-06 11:04:24 EST
Entered bug 27840 for the JavaProjectElementInfo.computeNonJavaResources().

We can still avoid to attach the source too early as described in this bug.
Comment 5 Jerome Lanneluc CLA 2002-12-09 07:01:41 EST
Changed implementation to lazy initialize SourceMapper.
Comment 6 David Audel CLA 2002-12-19 05:00:48 EST
Verified.