RFR: 8309583: AArch64: Optimize firstTrue() when amount of elements < 8
Chang Peng
duke at openjdk.org
Mon Jun 19 07:58:05 UTC 2023
On Thu, 8 Jun 2023 09:15:27 GMT, Andrew Haley <aph at openjdk.org> wrote:
> Where is the benchmark? You don't seem to have included it in this PR.
@theRealAph
Sorry for the delay. Original performance was measured by a simple benchmark only measuring firstTrue()'s performance written by myself. When I wanted to add it to JDK I found an existing benchmark used to measure different mask operations' performance ([jdk/test/micro/org/openjdk/bench/jdk/incubator/vector/MaskQueryOperationsBenchmark.java at master · openjdk/jdk · GitHub](https://github.com/openjdk/jdk/blob/master/test/micro/org/openjdk/bench/jdk/incubator/vector/MaskQueryOperationsBenchmark.java)). I tried to measure firstTrue()'s performance by this benchmark, but I found Blackhole‘s proportion of hottest region is too high, like following:
[Hottest Methods (after inlining)]..............................................................
57.15% c2, level 4 org.openjdk.jmh.infra.Blackhole::consumeFull, version 867
41.99% c2, level 4 org.openjdk.bench.jdk.incubator.vector.jmh_generated.MaskQueryOperationsBenchmark_testFirstTrueLong_jmhTest::testFirstTrueLong_thrpt_jmhStub, version 883.
So I spent some time on fixing this benchmark to measure mask operations' performance effectively. After this update, the proportion of blackhole is below 10% for each benchmark function. And I also updated the performance of firstTrue() measured by this benchmark when there are only 2 or 4 elements in boolean masks.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14373#issuecomment-1596687337
More information about the hotspot-compiler-dev
mailing list