RFR: 8299970: Speed up compiler/arraycopy/TestArrayCopyConjoint.java [v2]

Tobias Hartmann thartmann at openjdk.org
Mon Feb 13 06:31:34 UTC 2023


On Thu, 9 Feb 2023 12:01:06 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> 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

Looks good to me too.

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12475


More information about the hotspot-compiler-dev mailing list