RFR: 8299962: Speed up compiler/intrinsics/unsafe/DirectByteBufferTest.java and HeapByteBufferTest.java
Emanuel Peter
epeter at openjdk.org
Wed Jan 11 14:00:12 UTC 2023
The test used a blanket `100_000` iterations to ensure C2 triggers for the relevant intrinsics of `jdk.internal.misc.Unsafe`.
I experimented lowering the number of iterations, and got the following results:
`100_000` (overkill, 8.5 sec) `5000`(very safe, 3 sec), `2000`(decent, 2.6 sec) and even `200` (ok, 2.5 sec).
I measured the time per `@run` statement (there are 6 over the two test files).
For `5000` I got the same count of intrinsifications per intrinsic.
For `2000` it dropped slightly, rarely an intrinsic was not intrinsified.
For `200` it dropped a bit more, and sometimes multiple intrinsics are not intrinsified.
If one uses `-Xbatch -X:-TieredCompilation`, then the cound does not change at all, even for `200`.
Since the marginal speedup from `5000` to `200` is very small, I decided to be on the **safe side**.
This is still a **speedup of 2.7x**.
-------------
Commit messages:
- 8299962: Speed up compiler/intrinsics/unsafe/DirectByteBufferTest.java and HeapByteBufferTest.java
Changes: https://git.openjdk.org/jdk/pull/11944/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11944&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8299962
Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/11944.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/11944/head:pull/11944
PR: https://git.openjdk.org/jdk/pull/11944
More information about the hotspot-compiler-dev
mailing list