On 07/08/2014 10:07 PM, Martin Buchholz wrote: > I updated my webrev and it is again "feature-complete". > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/IdentityHashMap-capacity/ > <http://cr.openjdk.java.net/%7Emartin/webrevs/openjdk9/IdentityHashMap-capacity/> > (old webrev at > http://cr.openjdk.java.net/~martin/webrevs/openjdk9/IdentityHashMap-capacity.0/ > <http://cr.openjdk.java.net/%7Emartin/webrevs/openjdk9/IdentityHashMap-capacity.0/> > )
The additional loop hurts in my benchmarks (10-15 percents slower). If removing it and adding a specific putAfterResize() method (without the "item == k" test), replacing "continue" with "return putAfterResize(k, value)", it's much better. NB: In one bench I clear the map each time it hits 1000 mappings, so that it always fit in some cache, which is about 4 times faster than going up to 1000*1000 mappings (clear() cost included), and make put internals costs variations more obvious (hopefully). -Jeff