JDK 9 RFR of 4477961: java.lang.Math.toDegrees(double) could be optimized

Brian Burkhalter brian.burkhalter at oracle.com
Mon Sep 22 21:10:30 UTC 2014


Hello,

Another relatively small numerics fix:

Issue:	https://bugs.openjdk.java.net/browse/JDK-4477961
Webrev:	http://cr.openjdk.java.net/~bpb/4477961/webrev.00/

Summary: Change constructs like “a * B / C” and “u / V * W” to “x * (Y / Z)” where lower case denotes a variable and upper case a constant. This forces the constant value (Y / Z) to be evaluated only once per VM instance, and replaces division of the variable with multiplication. The resulting performance improvement is more than 300% as measure by JMH on a MacBookPro11,1 dual core i7 running Mac OS 10.9.5.

Thanks,

Brian


More information about the core-libs-dev mailing list