Bug 95244

Summary: performance optimization in SourceMapper.computeAllRootPaths
Product: [Eclipse Project] JDT Reporter: John Wiegand <John_Wiegand>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description John Wiegand CLA 2005-05-13 20:20:06 EDT
M7 candidate.

turned verbose on.  For the 1.4.2 src.zip, the following change improved the 
time to compute the root path from 450ms to 170ms.

optimization is to assume that most first level package names are already in 
the collection so check this first before doing any further analysis (since if 
it is already in the collection, we know we won't have to add it!)

code snippet follows:

							if (!
firstLevelPackageNames.contains(firstLevelPackageName)) {
								IStatus status 
= JavaConventions.validatePackageName(firstLevelPackageName);
								if (status.isOK
() || status.getSeverity() == IStatus.WARNING) {
								
	firstLevelPackageNames.add(firstLevelPackageName);
								}
							}
Comment 1 Olivier Thomann CLA 2005-05-17 23:09:54 EDT
Fixed and released in HEAD.
Comment 2 Frederic Fusier CLA 2005-05-27 06:25:46 EDT
Verified for 3.1 RC1 with build I20050527-0010.