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

Bug 338582

Summary: consider optimization by avoiding the role cache
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Keywords: noteworthy
Version: 0.8   
Target Milestone: 0.8 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed implementation none

Description Stephan Herrmann CLA 2011-03-01 15:07:23 EST
As posted in http://www.eclipse.org/forums/index.php?t=msg&th=205390
we should consider a possible optimization that can be achieved by 
simply avoiding use of the internal cache for specific role classes 
where state and role identity are irrelevant.
Comment 1 Stephan Herrmann CLA 2011-03-10 12:46:52 EST
Created attachment 190886 [details]
proposed implementation

This patch implements the instantiation policy ALWAYS.
We already prepare for supporting more instantiation policies,
but only ONDEMAND and ALWAYS are currently implemented.

I might mention that for ALWAYS we still generate the role cache,
which is a tiny bit of waste, but not generating it would require
more changes to ensure no-one attempts to access the inexistent cache.

The patch also contains the proposed changes to the OTJLD.
Comment 2 Stephan Herrmann CLA 2011-04-16 15:29:00 EDT
Marking as fixed after I could observe >20% speedup in the jdtnullity plug-in.

If other levels beside ONDEMAND and ALWAYS are desired I will open separate bugs.
Comment 3 Stephan Herrmann CLA 2011-04-30 18:52:21 EDT
Verified for 0.8M6 (sic)  using build 201104300913

note 1: this was already shipped with M6 but never verified at that time
note 2: the speed-ups may be lower than reported in comment 2,
   today (on a different machine) I observed approx 5-10% speed-up