[aarch64-port-dev ] [10] RFR(S): JDK-8184943: AARCH64: Intrinsify hasNegatives

Dmitry Chuyko dmitry.chuyko at bell-sw.com
Thu Jul 20 13:26:08 UTC 2017


Andrew,

Just a couple of quick questions on the micro-benchmark:

- What's the purpose of using custom Sink class instead of JMH's 
Blackhole? Is that a check of mixing calculation with actual write of 
its result? I see Blackhole usage in loopingMethod() and testMethod() 
variants, loopingFastMethod below uses Sink.
- What's the purpose of nested 1000 iteration loops? I guess that may 
test impact in case of on loop unrolling. Again, I see testMethod() 
variant without the loop.

-Dmitry Chuyko

On 07/20/2017 03:55 PM, Andrew Haley wrote:
> Hi,
>
> On 20/07/17 11:03, Dmitrij Pochepko wrote:
>
>> Please review this small webrev [1] that implements an enhancement [2] which adds has_negatives intrinsic to AARCH64 OpenJDK port. This intrinsic performs better than c2-compiled code for every array size tried:
> Yay!  We're off to the races!
>
> Yours:
>
> Benchmark                       (length)  Mode  Cnt      Score   Error  Units
> HasNegatives.loopingFastMethod         4  avgt    5   6680.619 ? 0.953  ns/op
> HasNegatives.loopingFastMethod        31  avgt    5  12936.791 ? 1.599  ns/op
> HasNegatives.loopingFastMethod        65  avgt    5  14604.253 ? 2.088  ns/op
> HasNegatives.loopingFastMethod       101  avgt    5  19606.385 ? 7.751  ns/op
> HasNegatives.loopingFastMethod       256  avgt    5  30858.498 ? 1.225  ns/op
>
>
> Stuart's:
>
> Benchmark                       (length)  Mode  Cnt      Score   Error  Units
> HasNegatives.loopingFastMethod         4  avgt    5   5013.024 ? 0.572  ns/op
> HasNegatives.loopingFastMethod        31  avgt    5   9186.044 ? 2.439  ns/op
> HasNegatives.loopingFastMethod        65  avgt    5  13769.220 ? 1.879  ns/op
> HasNegatives.loopingFastMethod       101  avgt    5  15854.385 ? 2.482  ns/op
> HasNegatives.loopingFastMethod       256  avgt    5  26691.626 ? 3.523  ns/op
>
> I didn't expect a big difference.  Note that the really important measurement
> is on length ~31, which is very common.
>
> Benchmark at http://cr.openjdk.java.net/~aph/HasNegativesBench/.  Test was on
> APM.
>



More information about the aarch64-port-dev mailing list