perf(builder): the shipped longshot-builder links with thin LTO, so a release builds it 2.5 times faster #2552
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2552
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:push-qmxpqzpkryuo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The longshot-builder a release ships was linked with fat LTO and one codegen unit. That final step runs on one core: 155 s on this PC (Ryzen 9 7900X), and about 20 minutes on the server's release runner (2 shared cores), which builds every release since #2538. With thin LTO and 16 codegen units, the builder compiles in 63 s here. A player's game build takes the same time with either binary.
Changed:
Cargo.toml'sdistprofile (lto = "thin",codegen-units = 16), and the two places that described it (scripts/longshot_builder.py's docstring, a row ofdocs/dev/reference/build.md).Testing
Tested: Linux (CachyOS, Ryzen 9 7900X, RTX 3090), one build-mode queue job per step: the builder compiled with each profile, then a fully cold game build with each binary (a fresh
LONGSHOT_CACHE, work folder and store, from the.nup,--no-prepare-shaders). Both game builds finished.Still to test:
distbuilds finish faster on the server's runner.Measurements
Verdict: the release builds the builder 2.5 times faster; players' game builds are unchanged; the download grows by 8.8 MB.
Setup: Linux, Ryzen 9 7900X; one run each.
8f730075(fat LTO)82f893a6(thin LTO)cargo build --profile dist, cold target)Risks
The players' download is 8.8 MB bigger. Code across crates is inlined a little less, which could make the lift slower. The lift took 5 s either way here, so a few percent of it doesn't show. Revert to go back to fat LTO.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (not run on this PC; this PR's CI runs it)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Possibly related, for context:
WIP: perf(builder): the shipped longshot-builder links with thin LTO, so a release builds it 2.5 times fasterto perf(builder): the shipped longshot-builder links with thin LTO, so a release builds it 2.5 times faster