← Wednesday, October 14, 2026Performance & OSDeep dive

antcc's -O2 build runs 1.4× slower than -O1 on a Lua benchmark

386s.org 13 min read Editor score 7/10

The compiler's Lua benchmark ran in 1.410 seconds at -O2 versus 1.077 seconds at -O1; disabling inlining appeared to remove the slowdown. The investigation highlights how compiler optimizations can regress performance and why benchmarks need scrutiny.

What
An investigation traces why antcc's -O2 build runs slower than -O1 on a simple Lua benchmark.
How
Inlining was suspected, but -O2 IR was only 11% larger while luaV_execute grew to about 43 KB, 2.4× its -O1 size.
Why it matters
The case shows how small IR growth can become large machine-code growth in a hot interpreter loop, making later compiler passes worth inspecting.
IR instructionselection registerallocation machine code
The compiler stages examined between optimized IR and machine code. Sketched from the article's own text.

Discussion

Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.

Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.

Your note

Private to you. Stored in this browser, and synced to your account when you are signed in.