RFR: 8373026: C2 SuperWord and Vector API: vector algorithms test and benchmark [v4]
Emanuel Peter
epeter at openjdk.org
Mon Jan 19 08:28:07 UTC 2026
On Fri, 16 Jan 2026 21:32:42 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> What exactly are you suggesting here? Are you suggesting that instead of doing:
>>
>> ` * @run driver ${test.main.class} noSuperWord`
>> we could do
>> ` * @run driver ${test.main.class} -XX:-OptimizeFill`
>>
>> And then just `framework.addFlags(args)`?
>
> Yes. Or introduce a property.
@iwanowww What do you mean by `property`?
>> Yes. Because they are not exactly the same. One is designed to test the implementation, the other to deliver reasonably stable and meaningful benchmarks.
>>
>> Example of some differences:
>> - In the "test" environment, I have access to test libraries like `Generators.java`, which are better at generating edge-cases than regular `Random`.
>> - In the benchmark, the size is a fixed parameter `SEED`. In the test, it is a randomly chosen value, so we can test better for alignment/drain/post loops.
>> - `eI` can be chosen randomly in each iteration of the test. But for the benchmark it is better if we have an array of values to chose from, so that we can pick different values for each benchmark invocation.
>>
>> But there is still a lot of overlap. I could try to split it into a "shared" and "local" part, and stuff the "shared" part into `VectorAlgorithmsImpl.Data`. @iwanowww Do you think that is worth it?
>
> Ok, up to you.
I'm not very satisfied with the duplication either. Maybe a mind refreshed from the weekend can come up with something better...
Btw: do you know any good way to share code between JMH benchmarks and regular tests? Because it is a shame that we have to duplicate `VectorAlgorithmsImpl.java`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28639#discussion_r2703710125
PR Review Comment: https://git.openjdk.org/jdk/pull/28639#discussion_r2703723987
More information about the hotspot-compiler-dev
mailing list