Intrinsics for Math.min and max

Martin Grajcar maaartinus at gmail.com
Tue Apr 1 21:30:09 UTC 2014


Done and attached. The results are pretty clear:

Benchmark                             Mode   Samples         Mean   Mean
error    Units
o.o.j.s.JmhMaxBenchmark.intrinsic     avgt       100        0.922
 0.001    ns/op
o.o.j.s.JmhMaxBenchmark.own           avgt       100        0.408
 0.005    ns/op

openjdk version "1.9.0-internal"
OpenJDK Runtime Environment (build
1.9.0-internal-maaartin_2014_02_18_06_05-b00)
OpenJDK 64-Bit Server VM (build 25.0-b62, mixed mode)
model name      : Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz

Regards,
Martin.



On Tue, Apr 1, 2014 at 10:42 AM, Andrew Haley <aph at redhat.com> wrote:

> On 04/01/2014 07:02 AM, Martin Grajcar wrote:
> > I wonder if these intrinsics still make sense when the compiler can
> > generate movcc itself. According to this SO question
> >
> http://stackoverflow.com/questions/22752198/java-math-min-max-performance
> > it can lead to a factor two slowdown (I guess a JMH benchmark would
> confirm
> > this).
>
> Exactly.  Will you do it?
>
> Andrew.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140401/dd2881da/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JmhMaxBenchmark.java
Type: text/x-java
Size: 2737 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140401/dd2881da/JmhMaxBenchmark.java>


More information about the hotspot-compiler-dev mailing list