9334994ce3
Mirrors the JVM benchmark (Secp256k1Benchmark.kt) for cross-platform
comparison of the same Kotlin code across runtimes:
K/Native LLVM AOT (-opt) on x86-64:
verifySchnorr: 101,406 ns (9,861 ops/s)
signSchnorr: 80,424 ns (12,434 ops/s)
FieldP.mul: 43 ns (22.8M ops/s)
JVM HotSpot C2 on same machine:
verifySchnorr: 53,600 ns (18,640 ops/s)
signSchnorr: 42,400 ns (23,518 ops/s)
K/N vs JVM: ~1.9× slower (vs C: ~2.9×)
K/N vs C native: ~2.9× slower
Includes field-level micro-benchmarks (FieldP.mul/sqr/add/sub/inv,
unsignedMultiplyHigh, uLt) for isolating LLVM codegen quality.
Also adds -opt to native test compilations for benchmark accuracy
(without it, debug mode is ~12× slower).
Run: ./gradlew :quartz:linuxX64Test --tests "*.Secp256k1NativeBenchmark"
https://claude.ai/code/session_01EMY5RnXb9rnsyU2KbXrSaY