RFR: [6904367]: (coll) IdentityHashMap is resized before exceeding the expected maximum size (original) (raw)

Peter Levart peter.levart at gmail.com
Sun Jul 13 15:25:31 UTC 2014


On 07/13/2014 01:24 PM, Jeff Hain wrote:

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

Can you post the benchmark source?

Thanks, Peter



More information about the core-libs-dev mailing list