Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343045

Summary: [compiler][smap] improve performance of smap generation
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.8   
Target Milestone: 0.8 M7   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
proposed fix and test adjustments none

Description Stephan Herrmann CLA 2011-04-16 12:29:32 EDT
When compiling large teams like, e.g.,
   org.eclipse.objectteams.internal.jdt.nullity.CompilerAdaptation
it can be observed that around 40% of the compilation time is spent in
generating the JSR-045 SMAPs, thus degrading the overall experience.
Comment 1 Stephan Herrmann CLA 2011-04-16 12:40:30 EDT
Created attachment 193419 [details]
proposed fix and test adjustments

The performance issue could be narrowed down to one specific loop
inside RoleSmapGenerator.fillSmap, where all line numbers of a source 
file are added to a FileInfo and to a LineInfoReminder. The check
LineInfoReminder.existsLineInfoFor looks a bit expensive.

At a closer look we were adding way too many line infos. For a role inside
a large team only the role's line number should be added not the whole
source file (= the team).

The patch fixes this and with this the effort of generating the SMAPs
could be reduced from around 40% to around 1%!

The patch also adjusts the test correspondingly.

This needs verification in real world debugging, once we have a new build.
Comment 2 Stephan Herrmann CLA 2011-04-16 12:44:04 EDT
Patch committed as r1435,6, awaiting verification.
Comment 3 Stephan Herrmann CLA 2011-04-17 15:36:01 EDT
Debugging works as before, marking this issue as fixed.
Comment 4 Stephan Herrmann CLA 2011-04-30 16:09:32 EDT
Verified for 0.8M7 using build 201104300913