Skip to content

[codex] Enable LTO for Linux and Windows actiond#20

Open
dzbarsky wants to merge 1 commit into
mainfrom
zbarsky/zig-lto
Open

[codex] Enable LTO for Linux and Windows actiond#20
dzbarsky wants to merge 1 commit into
mainfrom
zbarsky/zig-lto

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Jun 14, 2026

Copy link
Copy Markdown
Member

Author: zbarsky-bot

Enable Zig LTO for linux-actiond and windows-actiond. zigopts = ["-flld", "-flto"] keeps Zig IR available to LLD, and linkopts = ["-flto"] enables LTO in the final cc_common.link action. darwin-actiond is unchanged because Zig 0.16 does not support using LLD to link Mach-O files; a final -flto alone cannot optimize the native Zig archive.

GitHub Actions run 27500458810 passed all five jobs. The Linux x86_64 LLVM smoke measured 315.286s for actiond and 316.572s for the host, a 0.996x ratio; the main comparison measured 269.181s and 273.404s, a 0.985x ratio. The Windows x86_64 LLVM smoke measured 323.007s for actiond and 323.048s for the host, a 1.000x ratio; the main comparison measured 352.265s and 366.565s, a 0.961x ratio. Absolute runner times varied, so the actiond/host ratios are the relevant comparison. This single run did not show a performance improvement from LTO.

Global --copt=-flto is not included because it also changes the guest Linux kernel and confounds the actiond comparison. actiond's C dependency is zstd, which is used during VM startup rather than action execution.

@dzbarsky dzbarsky marked this pull request as ready for review June 14, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant