Bug 417896 - Performance of org.eclipse.internal.xtend.util.Cache can be improved
Summary: Performance of org.eclipse.internal.xtend.util.Cache can be improved
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: M2   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, performance
Depends on:
Blocks:
 
Reported: 2013-09-24 06:03 EDT by Ed Merks CLA
Modified: 2017-10-31 10:58 EDT (History)
1 user (show)

See Also:
karsten.thoms: luna+


Attachments
The proposed changes (789 bytes, patch)
2013-09-24 06:03 EDT, Ed Merks CLA
karsten.thoms: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Merks CLA 2013-09-24 06:03:42 EDT
Created attachment 235745 [details]
The proposed changes

The current implementation always calls both internal.containsKey and internal.get which are essentially equality expensive.  By calling get and checking for non-null and checking for containsKey only when null, will improve performance for the most common case where they key is present and the value is non-null.
Comment 1 Karsten Thoms CLA 2013-09-24 06:53:36 EDT
Same solution can be applied to classes WeakCache and TripleKeyCache.
Comment 2 Karsten Thoms CLA 2013-09-24 06:56:30 EDT
Pushed to master
Comment 3 Eclipse Webmaster CLA 2017-10-31 10:46:53 EDT
Requested via bug 522520.

-M.
Comment 4 Eclipse Webmaster CLA 2017-10-31 10:58:07 EDT
Requested via bug 522520.

-M.