EDIT: Nevermind, I see you addressed this. From the Javadoc: This method uses a backward loop. It is significantly faster than the corresponding method in {@link java.util.Arrays}
While we would need to benchmark whether this is still true in OpenJDK 9 and up (where they introduced the vectorized loops), I can see it still being true in the OpenJDK 8 that we are targeting.
BigArrays.equals should use java.util.Arrays.equals for all sub arrays. This would allow us to take advantage of the hotspot intrinsics OpenJDK has for those (including vectorization in later JVM releases).
Except for the KEYS_USE_REFERENCE_EQUALITY case, in which case we will still need a handwritten loop to force the == comparison.
EDIT: Nevermind, I see you addressed this. From the Javadoc:
This method uses a backward loop. It is significantly faster than the corresponding method in {@link java.util.Arrays}
While we would need to benchmark whether this is still true in OpenJDK 9 and up (where they introduced the vectorized loops), I can see it still being true in the OpenJDK 8 that we are targeting.BigArrays.equals
should usejava.util.Arrays.equals
for all sub arrays. This would allow us to take advantage of the hotspot intrinsics OpenJDK has for those (including vectorization in later JVM releases).Except for the
KEYS_USE_REFERENCE_EQUALITY
case, in which case we will still need a handwritten loop to force the==
comparison.