TLDR Dev · ARTICLES & TUTORIALS
HOW A 40-LINE FIX ELIMINATED A 400X PERFORMANCE GAP
Summary from the TLDR Dev newsletter
A method in OpenJDK on Linux previously suffered from a severe 30x-400x performance gap. The slower implementation was due to standards requiring a less direct approach for user CPU time, unlike the faster `clock_gettime()` function used for total CPU time. A recent 40-line fix exploited an obscure yet stable Linux kernel detail to enable `clock_gettime()` to directly retrieve user-time-only, improving performance a lot.