How to Win Frames and Influence Pointers
summary
Datadog contributions plus collaboration with the Go runtime team replace slow unwind-table stack walking with frame pointer unwinding, cutting stack-trace cost from ~1µs to ~20ns and dropping the execution tracer overhead from pathological 700% to about 30% in microbenchmarks and to go1.21 reduced overhead to <1% for most real apps. Fixes include handling stack-copying pointer updates and ARM64 compiler ordering bugs. Use go test -trace, go tool trace, runtime/trace or the new flight-recording libraries to capture low-overhead traces in production.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 0:24Execution tracing in Go matters
- 1:26Inefficiencies in net/http tests
- 3:12Go tracer for performance analysis
- 4:56Debug goroutine leaks with tracing
- 6:38Fixing the test and measuring improvements
- 7:19How Go tracer works
- 8:23Goroutine states and scheduling
- 9:25Execution tracing for latency
- 10:29Tail latency examples
- 11:54CPU spikes and GC impact
- 13:38Tracing overhead problem
- 15:28Collaborating with Go team
- 16:09Optimizing stack unwinding
- 18:59Frame pointer unwinding challenges
- 20:25Debugging crashes and loops
- 21:52Frame pointer fixes on ARM64
- 22:35Self-referential stack pointer risks
- 23:55Contributing upstream lessons
- 24:38Deployment issues
- 25:44Call to action: Use tracing
- 26:47Tools for execution traces
- 27:29Acknowledgments








