Inlining
Inlining is a compiler or runtime transformation that replaces a function or method call with its implementation at the call site.
Clojure: The Essential Reference
Inlining is a compilation technique that substitutes an alternative implementation for a var invocation instead of using its root or thread binding.
- How it is used
- Uses inline implementations chiefly to improve Java interop overload selection at direct calls.
- How deep it goes
- Explains var precedence, definline expansion, call behavior, and a compiled interop example; does not develop a general compiler implementation.
- Examples
- Compares direct calls with map, then contrasts Object and primitive Java overloads through an inlined wrapper.
- What you can do after
- Apply it via definline to expose a direct-call Java interop implementation while retaining ordinary function use.
Read how Clojure: The Essential Reference explains inlining →
Modern C
Inlining is a compiler transformation that replaces a function call with the called function's implementation in the caller's context.
- How it is used
- Reduces function-call overhead and exposes callee instructions to further optimization.
- How deep it goes
- Explains call overhead, definition visibility, and optimization opportunities without detailing compiler heuristics or generated machine code.
- Examples
- Uses an inline toto_init definition in a header and a separate declaration for one translation unit.
- What you can do after
- Apply it via visible C function definitions while managing header inclusion and one-translation-unit instantiation.
Modern C, Third Edition
Inlining is a compiler transformation that replaces a function call with the called function's implementation.
- How it is used
- Uses function-definition visibility to reduce call overhead and expose additional compiler optimizations.
- How deep it goes
- Explains replacement semantics, call overhead, optimization opportunities, and definition-visibility strategies across translation units.
- Examples
- Uses a small inline initializer, a header definition, and a separate translation-unit declaration.
- What you can do after
- Evaluate when visible C definitions can eliminate call overhead and enable context-sensitive optimization.
100 Go Mistakes and How to Avoid Them
Inlining is a compiler transformation that replaces a function call with the body of the called function.
- How it is used
- Uses compiler inlining to explain optimization-aware Go benchmarking and fast-path implementation choices.
- How deep it goes
- Explains substitution, budgets, diagnostics, benefits, mid-stack behavior, and benchmark consequences without detailing compiler internals.
- Examples
- Demonstrates popcnt benchmarks, sum substitution, compiler budget diagnostics, and sync.Mutex fast- and slow-path structure.
- What you can do after
- Diagnose misleading Go benchmarks and inspect compiler inlining decisions with -gcflags "-m=2".
Read how 100 Go Mistakes and How to Avoid Them explains inlining →
Related concepts
- performance optimizationkind of · Performance optimization is the process of modifying a system or its implementation to improve measured characteristics such as speed, throughput, or resource efficiency.
- compilerused by · A compiler is software that translates source code into another representation, often executable or lower-level code, while analyzing it according to language rules.
- calladdresses · A call is an invocation that requests execution of a function, routine, command, or tool, optionally supplying arguments.
- function call overheadaddresses · Function call overhead is the execution cost of invoking a function beyond the cost of executing its body.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



