RFR: 7903912: JMH: Pad using a mix of bytes and longs
Aleksey Shipilev
shade at openjdk.org
Mon Dec 16 12:10:01 UTC 2024
On Sun, 15 Dec 2024 18:51:54 GMT, Claes Redestad <redestad at openjdk.org> wrote:
> Using a mix of bytes and longs we should get the gap-filling effect described in https://shipilev.net/jvm/objects-inside-out/#_observation_hierarchy_tower_padding_trick_collapse_in_jdk_15 while reducing size of generated code by roughly 20%:
>
>
> 864772 jmh-samples/target/jmh-samples-1.38-SNAPSHOT.jar
> 490531 jmh-samples/target/jmh-samples-1.38-SNAPSHOT-sources.jar
>
> 684383 jmh-samples/target/jmh-samples-1.38-SNAPSHOT.jar
> 399758 jmh-samples/target/jmh-samples-1.38-SNAPSHOT-sources.jar
It is an interesting concept, huh. I think we need to have an argument whether the superclasses are guaranteed not to have the gaps totaling >16 bytes, otherwise this padding would fail again. I guess the JDK 15 layouter code we are protecting against here actually gives us that implementation "guarantee". Maybe that guarantee is even stronger, at 8 bytes? Need to think about it. I think this has legs. Submit a proper CODETOOLS-* bug against JMH. Even if this does not work out, we will record it as a negative result for future reference.
Don't bother with test failures in `CompilerProfilerTest`, I think it is [CODETOOLS-7903911](https://bugs.openjdk.org/browse/CODETOOLS-7903911).
-------------
PR Comment: https://git.openjdk.org/jmh/pull/147#issuecomment-2545038506
PR Comment: https://git.openjdk.org/jmh/pull/147#issuecomment-2545096904
More information about the jmh-dev
mailing list