RFR: 8186958: Need method to create pre-sized HashMap

liach duke at openjdk.java.net
Wed Mar 23 21:08:56 UTC 2022


On Wed, 23 Mar 2022 18:41:59 GMT, XenoAmess <duke at openjdk.java.net> wrote:

> 8186958: Need method to create pre-sized HashMap

test/jdk/java/util/Collections/CalculateHashMapCapacityTestJMH.java line 42:

> 40: public class CalculateHashMapCapacityTestJMH {
> 41: 
> 42:     private void consume(int tmp) {

You should pass a jmh Blackhole object in the parameter of test methods and call its consume method. jmh will automatically pass the blackhole. This one will be eliminated as dead code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7928


More information about the core-libs-dev mailing list