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

Peter Levart peter.levart at gmail.com
Thu Jul 10 12:49:01 UTC 2014


On 07/08/2014 11:30 PM, Martin Buchholz wrote:

Benchmarks welcome.

I have run your latest webrev with the following benchamrk:

@State(Scope.Thread) public class IHMBench {

 Map<Object, Object> map = new IdentityHashMap<Object, Object>();

 @Benchmark
 public void putNewObject(Blackhole bh) {
     Object o = new Object();
     bh.consume(map.put(o, o));
     if (map.size() > 100000) {
         map = new IdentityHashMap<Object, Object>();
     }
 }

}

Using:

java -Xmx4G -Xms4G -jar benchmarks.jar -f 0 -i 30 -wi 10 -t 1 -gc 1

...and results are:

Original:

Benchmark Mode Samples Score Score error Units j.t.IHMBench.putNewObject thrpt 30 13305370.384 80122.977 ops/s

Patched:

Benchmark Mode Samples Score Score error Units j.t.IHMBench.putNewObject thrpt 30 13364374.454 124491.206
ops/s

Seems performance is the same.

Regards, Peter



More information about the core-libs-dev mailing list