Observations from a simple JMH benchmark

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Feb 15 12:58:48 UTC 2018


> I have been playing around with a simple benchmark and JMH (separately i can get asm hotspots working on the mac now via dtrace!)
...
> Vladimir, i guess this is the kind of thing you were mentioning with regards to bounds checks?

Yes.

> Perhaps there are general optimization possibilities for such bounds checks. Only Preconditions.checkIndex is currently an intrinsic.

I proposed some tweaks earlier [1], but haven't done any experiments yet:

   0 <= i
   (i + vlen) <= length
==>
   (a) 0 <= i <= (length - vlen)
   (b) (vlen <= length)

a - upper bound is loop invariant
b - loop invariant

Best regards,
Vladimir Ivanov

[1] 
http://mail.openjdk.java.net/pipermail/panama-dev/2017-December/000889.html



More information about the panama-dev mailing list