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?
The core idea is you don't ask "is our GPU (or whatever is being built) as fast as the last one?" You don't even ask "is it as good as any GPU ever made?"
You instead ask "is it as fast as the speed of light?"
In other words, if you just waved away everything slowing you down, what's the absolute fastest you could complete your task? ONLY once you know that can you start putting back the other factors that slow you down: first you must start by comparing to the fastest possible way things could be ("speed of light").
Similar idea here.
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.
> 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.
But they involve a trade-off in the Linux kernel or spending more transistors in CPU design.
[dead]
One of the white papers he references, from 2009, by Mytkowicz et al. is titled "Producing Wrong Data Without Doing Anything Obviously Wrong!" and is worth at least a skim through, if not a full read. The starting abstract:
> This paper presents a surprising result: changing a seemingly innocuous aspect of an experimental setup can cause a systems researcher to draw wrong conclusions from an experiment. What appears to be an innocuous aspect in the experimental setup may in fact introduce a significant bias in an evaluation. This phenomenon is called measurement bias in the natural and social sciences. Our results demonstrate that measurement bias is significant and commonplace in computer system evaluation. By significant we mean that measurement bias can lead to a performance analysis that either over-states an effect or even yields an incorrect conclusion. By commonplace we mean that measurement bias occurs in all architectures that we tried (Pentium 4, Core 2, and m5 O3CPU), both compilers that we tried (gcc and Intel’s C compiler), and most of the SPEC CPU2006 C programs. Thus, we cannot ignore mea surement bias. Nevertheless, in a literature survey of 133 recent papers from ASPLOS, PACT, PLDI, and CGO, we determined that none of the papers with experimental results adequately consider measurement bias.
The relevant passage from the paper in relation to Dr Berger's talk:
> The most important point to take away from this graph is that depending on the shell environment size we may conclude that (i) the O3 optimizations are beneficial (i.e., the y value is greater than 1.0); (ii) the O3 optimizations degrade performance; and (iii) increasing the UNIX environment size does not predict the O3 speedup because as the size increases speedup increases and decreases, ranging from 0.91 to 1.07
[1] https://www.youtube.com/watch?v=r-TLSBdHe1A [2] https://users.cs.northwestern.edu/~robby/courses/322-2013-sp...
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.
[dead]
Sure, sometimes fat is good. Fat is compromise. Fat might be orthogonal concerns. But you'll never get leaner than that essential muscle mass.
I guess in their case "speed of light" is the leanest muscle mass required.
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.
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).
> Give a CPU the same registers, the same memory and the same instructions, and it computes the same result.
So is branch prediction, cacheline misses, memory accesses I guess.
> One more outside influence is easy to miss: other CPUs. On two cores, which thread wins a race comes down to cache misses and pipeline stalls, so Rewind provides a single virtual CPU and the threads take turns on it.
Is this a limitation in practice? With a single virtual cpu, data races simply can't happen?
(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.
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.
I'm not sure if I understand. Do you mean ordered by amount of time spent, or by event time in the executable? (Most profilers do the former, and flame graphs are implicitly a variant of that by scaling the blocks visually by execution time.)
> They also show hierarchy, rather than just leafs.
Like any profiler in graph mode? Every profiler I've used over the last 20 years (even gprof!) can show function hierarchy, both top-down and bottom-up.
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.
[dead]
[dead]
Here is my small contribution to the altar though : 3d flame graphs :)
no one ever bothered to look. a profile found it instantly
[dead]
I tried to combine both orientations in a 3d visualization here: