Closed chrisc36 closed 6 years ago
Very good catch and please do submit a pull request to Eclipse Collections!
@chrisc36 this has been fixed in Eclipse Collections via PR: https://github.com/eclipse/eclipse-collections/pull/401 It will be a part of Eclipse Collections 9.1.0 release.
Another performance issue, I can look into patching this on the Eclipse Collections project as well.
For, primitive object maps, "ObjectHashMap" the "getIfAbsent" method calls the
probe
function twice, basically doubling the cost of a hash lookup. The problem are the lines:the precomputed
index
value is recomputed from scratch on the second line!