RFR: 8309583: AArch64: Optimize firstTrue() when amount of elements < 8 [v3]

Chang Peng duke at openjdk.org
Sun Jun 25 02:48:17 UTC 2023


On Wed, 21 Jun 2023 14:25:57 GMT, Andrew Haley <aph at openjdk.org> wrote:

> Something is wrong with your setup. You should be seeing this: `# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)`
> 
> not this: `# Blackhole mode: full + dont-inline hint (default, use -Djmh.blackhole.autoDetect=true to auto-detect)`

@theRealAph Sorry for the delay, I was on holiday last week.

I found that we can avoid the effects of blackhole by using ``` -Djmh.blackhole.autoDetect=true ```, so I have reset this benchmark.

Following is the performance of ``` testFirstTrueInt ``` and ``` testFirstTrueLong ``` before and after this patch:


Benchmark                                       bits    (inputs)  Mode  Before      After      Units
MaskQueryOperationsBenchmark.testFirstTrueInt   128           1  thrpt  520650.354  580091.081 ops/ms
MaskQueryOperationsBenchmark.testFirstTrueInt   128           2  thrpt  520677.937  580391.661 ops/ms
MaskQueryOperationsBenchmark.testFirstTrueInt   128           3  thrpt  519967.269  580705.642 ops/ms
MaskQueryOperationsBenchmark.testFirstTrueLong  128           1  thrpt  518563.126  575941.490 ops/ms
MaskQueryOperationsBenchmark.testFirstTrueLong  128           2  thrpt  517329.190  578848.383 ops/ms
MaskQueryOperationsBenchmark.testFirstTrueLong  128           3  thrpt  517987.339  577601.752 ops/ms


And following are the corresponding JMH output:
before my patch: https://gist.github.com/changpeng1997/3ebe4b7beea93716d9f29d4ef71641af
after my patch: https://gist.github.com/changpeng1997/d306957370eb0bdbb8e71b601440cdaa

We can see the C2 code of firstTrue().

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14373#issuecomment-1605831986


More information about the hotspot-compiler-dev mailing list