A deep dive into JVM stubs and intrinsics, explaining how they are generated at startup, how they enable high-performance execution of critical operations like Math.pow and System.arraycopy, and how to inspect or disable them. The post covers the four stub generation phases (initial, continuation, compiler, final), demonstrates how to print generated stubs and intrinsics using JVM flags, and benchmarks four configurations: intrinsics fully on, disabled via InlineNatives, disabled via ControlIntrinsic, and disabled via UseLibmIntrinsic. Profiler results reveal why the intrinsified path is ~4-18x faster, tracing the fallback chain through FdLibm, JNI overhead, and SharedRuntime::dpow.

11m read timeFrom softwaremill.com
Post cover image
Table of contents
EnvironmentStubsIntrinsicsPerformance AnalysisConclusion

Sort: