RFR(S): 8249198: Faster Math.signum(fp) for positive and negative numbers
Brian Burkhalter
brian.burkhalter at oracle.com
Fri Jul 10 20:56:41 UTC 2020
Hi Dmitry,
Regarding the benchmarks [1], I was curious as to why you chose to use the reduce() method, which inside it loops over invocations of signum(), given the considerations discussed in the sample JMHSample_11_Loops.java [2]? Is that in order to force inlining? I have not used the @CompilerControl annotation.
Thanks,
Brian
[1] http://cr.openjdk.java.net/~dchuyko/8249198/webrev.00/test/micro/org/openjdk/bench/java/lang/DoubleSignum.java.html
http://cr.openjdk.java.net/~dchuyko/8249198/webrev.00/test/micro/org/openjdk/bench/java/lang/FloatSignum.java.html
[2] https://hg.openjdk.java.net/code-tools/jmh/file/4a420afe8a9e/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_11_Loops.java
> On Jul 10, 2020, at 1:28 PM, Joe Darcy <joe.darcy at oracle.com> wrote:
>
> I'll leave it to others to review the benchmarks.
More information about the core-libs-dev
mailing list