RFR: 8299970: Speed up compiler/arraycopy/TestArrayCopyConjoint.java [v2]
Emanuel Peter
epeter at openjdk.org
Thu Feb 9 12:01:06 UTC 2023
> I lowered the iteration count from `1000_000` (million) down to `30_000` (30k). I also removed a `try-catch` statement that seems to serve no purpose, but may actually prevent us from detecting failures of the test.
>
> Per `@run` statement, I got the runtime down from about `4-4.5 sec` to `1-1.3 sec` (3-4x speedup).
>
> **Details**
> I ran the test with `-XX:+PrintCompilation -XX:+PrintInlining -XX:-TieredCompilation -XX:CICompilerCount=1 -Xbatch`, and then analyzed the output with this `cat txt.txt | sed -n -e "s/.*java.lang.System::(\w*).*intrinsic.*/\1/p" | sort | uniq -c`, which gives me the count for the `arraycopy` intrinsification. For `1000_000` and `30_000` iterations I got `336` intrinisifications, so I am not losing any. I also tried to lower the iterations further down to `10_000`, but that did only marginally lower the runtime, to `1 sec`, but with much less intrinsifications, only `144`. So I decided to stay at `30k`.
>
> If this fix does not turn out to be sufficient, we can try an IR test, and trigger compilation of the test methods after a much smaller iteration count for warmup (after all we want to make sure intrinsification happens), and then verify that the intrinsic is in the IR.
>
> **Update**
> I applied the same changes to `compiler/arraycopy/TestArrayCopyDisjoint.java`, verified that no intrinsification was lost. Marginal speedup from `1 sec` down to `0.7 sec` per run statement.
Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
did same with TestArrayCopyDisjoint.java
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/12475/files
- new: https://git.openjdk.org/jdk/pull/12475/files/48cbd4c2..1ef3860f
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=12475&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=12475&range=00-01
Stats: 21 lines in 1 file changed: 0 ins; 5 del; 16 mod
Patch: https://git.openjdk.org/jdk/pull/12475.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12475/head:pull/12475
PR: https://git.openjdk.org/jdk/pull/12475
More information about the hotspot-compiler-dev
mailing list