mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
The JVM target is Java 21, so Math.unsignedMultiplyHigh (Java 18+) can be called directly without MethodHandle reflection. The previous approach used MethodHandle.invokeExact which Kotlin compiles with Object return type, causing Long boxing on every call (3 box/unbox per invocation × 16 calls per field multiply = 48 boxed objects per mul). Direct call compiles to a single UMULH instruction with zero overhead. This is the most performance-critical function: called ~12,000× per signature verification. https://claude.ai/code/session_01BhU63WUe9AhikZxRdw3Lpg