On Mon, 22 Jan 2024 17:45:45 GMT, Volker Simonis <[email protected]> wrote:
>> Joshua Cao has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> putAll presize based on sum on both map sizes
>
> test/micro/org/openjdk/bench/java/util/concurrent/Maps.java line 122:
>
>> 120: @Benchmark
>> 121: public ConcurrentHashMap<Integer, Integer>
>> testConcurrentHashMapPutAll() {
>> 122: ConcurrentHashMap<Integer, Integer> map = new
>> ConcurrentHashMap<>();
>
> I think this benchmark could be made more accurate by creating the new,
> temporary map with the right initial size (i.e. `ConcurrentHashMap<>(nkeys)`)
> to avoid calls to `tryPresize()` in this setup step.
I updated. The numbers are surprisingly the same. I guess the benchmark compute
time is dominated by putAll().
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17116#discussion_r1462481286