RFR: 8350682: [JMH] vector.IndexInRangeBenchmark failed with IndexOutOfBoundsException for size=1024

Vladimir Ivanov vaivanov at openjdk.org
Sat Mar 1 00:49:53 UTC 2025


On Sat, 1 Mar 2025 00:40:26 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Array initialization by parameter was added. Extra constant was used to align cycle step with used arrays.
>
> test/micro/org/openjdk/bench/jdk/incubator/vector/IndexInRangeBenchmark.java line 51:
> 
>> 49:     @Setup(Level.Trial)
>> 50:     public void Setup() {
>> 51:         mask = new boolean[size + 64];
> 
> Any reason, for this to be "size + 64" instead of "size"?

This array iterated by steps from 8 to 64. If allocated array less than 64 it throws Exception.
Minimal array size is VectorSpecies for byte class. The constant was used instead of calculation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23783#discussion_r1976181678


More information about the core-libs-dev mailing list