Function Inlining
summary
Explains what Go actually inlines, how the compiler decides (an inlining budget that favors small leaf functions), and practical tricks that work: split large methods, replace debug branches with constant debug guards so the compiler can remove them, and prefer local simple code instead of extra calls. Shows how to verify results with go test -bench -v / build verbose output, notes recent Go versions improve inlining and can make existing binaries measurably faster.
AI-written summary · about
chapters (8)
- 0:00Function inlining introduction
- 3:19When inlining improves performance
- 6:40Risks and limits of inlining
- 10:16Inlining with constants
- 13:48Cas pratiques et exemples concrets
- 17:20Advanced optimizations
- 20:16Quand éviter l'inlining
- 22:23Bilan et recommandations finales
related talks
35mInlining: bright victories and hidden defeats
06mProfile-Guided Optimization in the Go Compiler
17mInlined Code Generation for Smalltalk
01h 04m“Understanding Optimizers: Helping the Compiler Help You”
29mOptimizing Go Code Without a Blindfold
34mGo Inline Assembler: Dream or Reality
26mHot Call-Chain Inlining for the Glasgow Haskell Compiler
55mTo Make Code Fast, All You Need Is… ☠️
