release: thin LTO and one codegen unit for the compute-bound translator #141

Open
github-bot wants to merge 1 commit from github-bot/gh-141 into main AGit
Owner

@⁠mattkajorinc on GitHub · 2026-11-26 07:07 UTC · original
mattkajorinc:perf/release-lto → main · +6 −0 · 1 files · 1 commits · open

Note: this workstation is Linux with no GPU and the repo only runs on Windows (D3D12), so nothing here was observed in a live run. The change is validated statically — cross-compiled for x86_64-pc-windows-msvc (the CI target) and x86_64-pc-windows-gnu, clippy-clean in the changed files, fmt-clean against the repo's rustfmt.toml, plus the host-side unit tests of the Linux-buildable crates. An A/B protocol is given for your hardware where a measurement matters.


The translator is compute-bound, and the release profile had no whole-program optimisation. This adds the standard maximum-performance release settings:

[profile.release]
lto = "thin"
codegen-units = 1

Thin LTO keeps build time close to the plain build's; a single codegen unit lets the final unit inline across the whole crate. profile.diag inherits these.

Validation: the profile is valid and lto = "thin" + codegen-units = 1 compiles and links end-to-end (verified with a --release build of the Linux-buildable crates); every crate still type-checks for x86_64-pc-windows-msvc (the CI target). A fully linked Windows .exe needs a Windows machine (this Linux workstation has neither the MSVC link.exe nor mingw's dlltool) — that is an environment limit, not a property of this change.

I could not measure the effect here (Linux, no GPU; the repo runs on Windows only), so this is a standard optimisation to A/B on your hardware: build a release with and without these lines and time an identical victory translate over the same input. If build time matters more than the last few percent, lto = "thin" alone is the conservative half.

**@⁠mattkajorinc** on GitHub · 2026-11-26 07:07 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/141) `mattkajorinc:perf/release-lto` → `main` · +6 −0 · 1 files · 1 commits · open Note: this workstation is Linux with no GPU and the repo only runs on Windows (D3D12), so nothing here was observed in a live run. The change is validated statically — cross-compiled for `x86_64-pc-windows-msvc` (the CI target) and `x86_64-pc-windows-gnu`, clippy-clean in the changed files, fmt-clean against the repo's `rustfmt.toml`, plus the host-side unit tests of the Linux-buildable crates. An A/B protocol is given for your hardware where a measurement matters. --- The translator is compute-bound, and the release profile had no whole-program optimisation. This adds the standard maximum-performance release settings: [profile.release] lto = "thin" codegen-units = 1 Thin LTO keeps build time close to the plain build's; a single codegen unit lets the final unit inline across the whole crate. `profile.diag` inherits these. Validation: the profile is valid and `lto = "thin"` + `codegen-units = 1` compiles and links end-to-end (verified with a `--release` build of the Linux-buildable crates); every crate still type-checks for `x86_64-pc-windows-msvc` (the CI target). A fully linked Windows `.exe` needs a Windows machine (this Linux workstation has neither the MSVC `link.exe` nor mingw's `dlltool`) — that is an environment limit, not a property of this change. I could not measure the effect here (Linux, no GPU; the repo runs on Windows only), so this is a standard optimisation to A/B on your hardware: build a release with and without these lines and time an identical `victory translate` over the same input. If build time matters more than the last few percent, `lto = "thin"` alone is the conservative half.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 07:07:49 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:33 UTC · original

Left open: thin LTO with one codegen unit also applies to the diag profile (it inherits release) and makes every build longer; no measurement yet. Maintainer's call.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:33 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/141#issuecomment-7185582164) Left open: thin LTO with one codegen unit also applies to the diag profile (it inherits release) and makes every build longer; no measurement yet. Maintainer's call.
This pull request has changes conflicting with the target branch.
  • Cargo.toml
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/141/head:github-bot/gh-141'
git switch 'github-bot/gh-141'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-141'
git switch 'github-bot/gh-141'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-141'
git switch 'github-bot/gh-141'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-141'
git switch 'main'
git merge --squash 'github-bot/gh-141'
git switch 'main'
git merge --ff-only 'github-bot/gh-141'
git switch 'main'
git merge 'github-bot/gh-141'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.