RFR: 8281631: HashMap.putAll can cause redundant space waste [v3]

XenoAmess duke at openjdk.java.net
Fri Feb 11 19:25:20 UTC 2022


On Fri, 11 Feb 2022 18:24:49 GMT, Andrew Haley <aph at openjdk.org> wrote:

> Just multiply by 0.75.
> 
> On a modern design, floating-point multiply is 4 clocks latency, 4 ops/clock throughput. FP max is 2 clocks latency, conversions int-float and vice versa 3 clocks latency, 4 ops/clock throughput. Long division is 7-9 clocks, 2ops/clock throughput. Shift and add 2 clocks, 2/3 ops/clock througput. Compare is 1 clock, 3 ops/clock throughput, conditional move is 1 clock, 3 ops/clock throughput.
> 
> Seems like it's a wash.

@theRealAph

no multiply but divide.

besides, did you count the cost for Math.ceil? it is the heaviest part.

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

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


More information about the core-libs-dev mailing list