The uniformity of arrays is vectorized in jdk-9(when it is possible as fas, as I can tell), according to this
Even the method inside has a definition like:
@HotSpotIntrinsicCandidate
static int vectorizedMismatch...
But this does not carry over to jdk-8.
As for bitwise manipulation, many operations have already been completed; as indicated by annotation @HotSpotIntrinsicCandidate.
It is best to actually check with a few options, for example:
-XX:-TieredCompilation
-XX:CICompilerCount=1
-XX:+UnlockDiagnosticVMOptions
-XX:+PrintCompilation
-XX:+PrintInlining
And check whether you have such recordings: Unsafe::getAndAddInt (27 bytes) (intrinsic).
And perhaps the last obvious point is what is your goal for speed here? Even if you don’t get insides where you really can think what you want, the speed may be in the range in which you want.
source
share