News for hackers. Stuff that matters.
Re:A 40-line fix eliminated a 400x performance gap by jonasn on Wednesday January 14, 2026 @03:48AM (#46613806)
Author of the OpenJDK patch here.

Thanks for the write-up Jaromir :) For those interested, I explored memory overhead when reading /proc—including eBPF profiling and the history behind the poorly documented user-space ABI.

Full details in my write-up: https://norlinder.nu/posts/User-CPU-Time-JVM/

Re:A 40-line fix eliminated a 400x performance gap by jerrinot on Wednesday January 14, 2026 @04:12AM (#46613952)
Hi Jonas, thanks for the work on OpenJDK and the post! I swear I hadn't seen your blog :) I finished my draft around Christmas and it’s been in the queue since. Great minds think alike, I guess.

edit: I just read your blog in full and I have to say I like it more than mine. You put a lot more rigor into it. I’m just peeking into things.

Re:A 40-line fix eliminated a 400x performance gap by jonasn on Wednesday January 14, 2026 @02:03PM (#46620938)
Thanks for the kind words and the link :).
Re:A 40-line fix eliminated a 400x performance gap by kstrauser on Wednesday January 14, 2026 @12:21PM (#46618920)
Why do you suppose it was originally written the way it was? To my eyes, that seems like a horrible approach. Doing file IO and parsing strings in every call? What?! And yet I assume the original author was a smart person who had a reason why this made sense to them, and my inability to guess why is my own limitation and not theirs.

So, why do you reckon they did that?

Re:A 40-line fix eliminated a 400x performance gap by jonasn on Wednesday January 14, 2026 @02:02PM (#46620921)
You are spot on that the original author had a valid reason: at the time, it was literally the only way to do it.

The method in question (Java 1.5) was released in September 2004. While the POSIX standard existed, it only provided a way to get total CPU time, not the specific user time that Java needed. You can read about it more in the history section here: https://norlinder.nu/posts/User-CPU-Time-JVM/#a-walk-through....

But it's worth noting that while this specific case can be "fixed" with a function call, parsing /proc is still the standard way to get data in Linux.

Even today, a vast amount of kernel telemetry is only exposed via the filesystem. If you look at the source code for tools like htop, they are still busy parsing text files from /proc to get memory stats (/proc/meminfo), network I/O, or per-process limits. See here https://github.com/hishamhm/htop/blob/master/linux/LinuxProc....

Re:A 40-line fix eliminated a 400x performance gap by kstrauser on Wednesday January 14, 2026 @02:28PM (#46621444)
That sounds like a pretty good reason!

I knew about using proc for all that other information. I just wouldn’t have imagined using it for critical performance path. Unless, that is, that’s the way you have to get the information.