RFR: 8332587: RISC-V: secondary_super_cache does not scale well [v8]

Andrew Haley aph at openjdk.org
Thu Jun 20 07:49:12 UTC 2024


On Wed, 19 Jun 2024 17:12:15 GMT, Gui Cao <gcao at openjdk.org> wrote:

> With the jmh test data, we see that there is a performance decrease from testNegative55 to testNegative64 when zbb is not available. This is because a loop is needed to count the number of 1 when Zbb is not available. I've tested this before on Banana Pi BPI-F3 board (has Zbb) and Disable UseZbb to using scalar registers as well, with similar data. When Zbb is available, the test data is better in all test cases except testNegative63, testNegative64. So the performance decrease here compared to when using Zbb is caused by the number of 1's counted using the scalar register loop.

Yes, exactly. There are faster general-purpose ways to calculate popcount (there's one in share/utilities/population_count.hpp) but the simple loop is better for small sets, which they almost always are in this case. And small code matters, because this is expanded a lot.

We could have an early exit for `SECONDARY_SUPERS_BITMAP_FULL` but because that doesn't occur in real code it'd only slow things down.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19320#discussion_r1647118639


More information about the hotspot-dev mailing list