RFR: 8299970: Speed up compiler/arraycopy/TestArrayCopyConjoint.java

Tobias Hartmann thartmann at openjdk.org
Wed Feb 8 19:48:45 UTC 2023


On Wed, 8 Feb 2023 19:38:56 GMT, Vladimir Kozlov <kvn 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.
>
> test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyConjoint.java line 268:
> 
>> 266:         System.out.println("PASS : " + validate_ctr);
>> 267:       } catch (Exception e) {
>> 268:         System.out.println(e.getMessage());
> 
> `try/catch` is there because `arraycopy` may throw exception due to some mess up in code generation and we want call stack and information about that to debug the issue.

But with that try/catch, no exception will be thrown and therefore the test would pass, right? And the exception would contain a stack trace, no need to catch it and print its contents.

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

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


More information about the hotspot-compiler-dev mailing list