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 →
Also covered in
What to know first
- accessor methodAn accessor method or function is a callable that reads, computes, or assigns a value associated with a property, field, or data element.
- calling conventionA calling convention is a set of binary-interface rules specifying how functions receive arguments, return values, preserve state, and manage calls.
- header fileA header file is a source file containing declarations, macros, or other shared interface information intended for inclusion in other source files during compilation.
- macro expansionMacro expansion is the compile-time transformation of a macro invocation into source tokens or language constructs according to its definition and expansion rules.
Related concepts
- performance optimizationkind of · Performance optimization is the systematic modification of a system or its operation to improve performance measures such as speed, responsiveness, throughput, or resource efficiency.
- compilerused by · A compiler is software that translates source code into another representation, such as machine code, bytecode, or an intermediate form.
- 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.
Questions about inlining
What is inlining?
Inlining is a compiler or runtime transformation that replaces a function or method call with its implementation at the call site.
Which Manning books explain inlining?
Clojure: The Essential Reference, Modern C, Modern C, Third Edition and 100 Go Mistakes and How to Avoid Them.
What should I know before learning inlining?
Manning books that teach inlining usually introduce accessor method, calling convention, header file and macro expansion first.
What kinds of inlining are there?
Kinds of inlining include mid-stack inlining.
What is inlining a kind of?
Inlining is a kind of performance optimization. Performance optimization is the systematic modification of a system or its operation to improve performance measures such as speed, responsiveness, throughput, or resource efficiency.
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.



