The author of antcc, a C compiler, discovered that -O2 produced code 1.4x slower than -O1 in a Lua benchmark due to aggressive inlining. The main culprit was the inlining of functions into luaV_execute, the Lua VM's bytecode interpreter loop, which ballooned to ~43KB and caused instruction cache thrashing. The investigation revealed the difficulty compilers face with large hot-loop functions containing many branching paths.
Background
antcc is a small, educational C compiler project by a developer known for systems programming work. The Lua VM reference implementation (luaV_execute) is a well-known challenging function for compilers due to its large size and complex control flow.
- Source
- Lobsters
- Published
- Oct 13, 2026 at 05:33 PM
- Score
- 5.0 / 10