I’ve noted a fair amount of anti-optimizations in some library code. Remember that just because a source file shipping with Java has an implementation doesn’t mean that it will be called on any hardware that you care about. Examples:
Using SWAR or Hacker’s Delight bit twiddling for stuff based on leading zeroes, trailing zeros or population count (floorlog2, nextpow2, etc, etc). ARM and Intel natively support these opcodes and HotSpot treats them as intrinsics.
Directly calling StrictMath instead of Math. StrictMath is always software implementation. Math equivalents are instrinics and don’t really forward to StrictMath (ignore ARM no-fp here…but regardless, the software Math version should be much faster)