208 points · by kqr · 11h ago · 38 comments
Personally I've really cooled on flamegraphs for the purpose of doing multithreaded performance analysis - it's so hard to infer cross-thread dependencies. I'd encourage people interested in performance analysis to read https://thume.ca/2023/12/02/tracing-methods/ (and I'd love to hear if there's something more recent than end of 2023 that has an updated census of tools) which makes a decent case for perfetto, though in my own use-cases I've just ended up creating low latency language-specific trace output library that I can aggregate and load into jaeger-ui, as you can actually add metadata indicating spans you follow from etc.
For the author: your product looks very cool, but I encourage you (or someone you pay!) to do an extensive proof reading pass to remove LLM-isms, reading stuff like "process, with what it started" as a column header of ps-like output is like nails on a chalkboard.
I agree, and I also like Antithesis, but I am a bit dismayed that deterministic high-performance VMs haven't become commodity yet.
I know, I know, I am impatient, and it will happen eventually, but it's frustrating to see Antithesis corner the market so hard with a closed solution.
Maybe this is a sign I should start yet another side project?
In terms of functionality, they're different. rr supports arbitrary timeslicing, e.g. thread switches at any program instruction, which ReplayVM does not. RewindVM depends on Nix, rr doesn't. RewindVM supports a kind of "mutable replay" where you can resume a VM from a checkpoint and cause it to do something different from what was previously recorded; rr's version of that is much more limited.
Their visualizations are techniques based around leveraging the extra data available in a full instruction trace. As such, they can be applied to any time travel debugger datastream, which trivially has a full instruction trace, or just raw instruction trace if that is all you have.
But they involve a trade-off in the Linux kernel or spending more transistors in CPU design.
> 4 Turns out that the test sleeps on purpose: it is checking how far uv_hrtime moves across a sleep. There is nothing to optimize in this case.
also, no explanation of why he didn't look into the epoll_wait(). i guess because this is a blocking call, not intentionally asleep, and also the intentional sleep is magnified 600 times? epoll_wait() shows up as consuming 3x of the wall time but in the shortening analysis the nanosleeps are shown to add up to more time asleep. i'm a little confused on that.
good article, would have been great with more editing. and it would be great to also see an example where a problem is fixed.
I wanted the article to be more about the idea and performance investigation rather than about this one bug though.
With this much insight, lots of software has lots of bugs.
I only looked at the first bug you list on the bugs.html page, and it doesn't appear to have needed or used the `time` tool. As this article is specifically about the `time` functionality, that's what I was complaining was missing from your article. Maybe that was an unfair complaint, as I can't find a single example on the internet (using Gregg's tooling, which has existed forever).
(It's fine, of course, to use AI tools—we use them heavily ourselves. Just please don't use them to generate or edit text to be read by fellow humans on Hacker News.)
It's impossible to know for sure what was LLM generated or edited, but we have to rely on imperfect classifiers or else the site would be completely flooded by genai text, which is not what the community here wants to read, nor in the intended spirit of HN.
At one job they had built this whole nifty SQL library and used it everywhere. In the first profile I took I saw that repeatedly preparing a query took more time than running it and using the data. Each call to prepare took the same amount of time as the others, so it was obvious at a glance that they weren’t caching and reusing the results. The documentation said that they did, and their tests all worked, so they had used it for years even though it was fundamentally broken. That was a fun week.
Unfortunately since then most wins haven’t been nearly as dramatic, but still a happy user of flame graphs.
I always struggle to see why people think flame graphs are so great, but I'm not sure if people are comparing them to a normal (non-graphical) profile or not.
But everything usually looks fine on local env, and can’t really replicate the intricacies of prod locally. How do you guys do it?
This thing also greatly helps when exploring unfamiliar codebases. You can just open a flame graph in a few clicks and see what the program actually does.
no one ever bothered to look. a profile found it instantly