Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.4.6
-
None
-
None
Description
Just happened to notice Utils.bufEquals(byte[], byte[]) as a rather large outlier (~7% CPU time) when running with an attached profiler.
By just simply switching the implementation to delegate directly to Arrays.equals(byte[], byte[]) the invocation disappears from the profile. The reason for this is that this is one of the methods which the JIT (not the interpreter) will generate an intrinsic for, using the builtin support of the CPU to do the check.
The fix is trivial
public static boolean bufEquals(byte onearray[], byte twoarray[] ) { return Arrays.equals(onearray, twoarray); }