Worshipping at the Altar of Brendan Gregg fzakaria.com · 46 points · 3 comments ...
HN Best 200 @best
Worshipping at the Altar of Brendan Gregg fzakaria.com · 46 points · 3 comments · HN thread
TL;DR Farid Zakaria announces "rewind time", a command in his Rewind deterministic VM that analyzes a recording's critical path and shows where wall-clock time went, including off-CPU sleeps. He demonstrates it on a libuv build and test run, which takes 78 s on one vCPU and has a 47.4 s critical path, two thirds of it asleep. The post credits Brendan Gregg's off-CPU, wakeup and flame graph work as the inspiration.
- On one vCPU the libuv build and tests take 78.0 s; the critical path is 47.4 s, so no number of CPUs can finish faster than that.
- 67% of the critical path is asleep (epoll_pwait 23.1 s, clock_nanosleep 8.53 s), which a CPU profiler cannot show.
- The test runner lt-run-tests accounts for 36.4 s of the path because its 287 tests run one after another, mostly waiting on timers.
- rewind where replays the deterministic run to a given step and uses gdb to show the exact source line of a sleep, such as uv_sleep in test-hrtime.c.
- Rewind already logs every context switch for replay, so it records wakeups and their causes at no extra tracing cost, unlike live off-CPU analysis.
- Output can be exported as folded stacks for flamegraph.pl or speedscope, or as a Perfetto trace.
Discussion The thread is small, with only two top-level comments. Both are positive and treat the post as a sign of what deterministic recording makes possible: one commenter on Python benchmarks sees determinism as the underrated part, while the other praises flame graphs for finding a hot regex quickly. The mood is appreciative and light, with little debate.
- Determinism makes benchmarking far more stable than wall-clock timing (some): A commenter maintaining a Python framework moved CI benchmarks to Callgrind instruction counts with pinned cache geometry, and says the numbers stopped drifting between runs. They note that instruction counting loses off-CPU time, which is what Rewind's critical path view covers.
- Flame graphs alone are worth the praise (a few): One commenter says flame graphs found a hot regex in their billing service within ten minutes, supporting the post's homage to Gregg's tooling.
#performance #profiling #deterministicVM #criticalPath #flameGraphs #offCpuAnalysis