Improve build performance with simple hot-path optimizations#1856
Closed
cpunion wants to merge 19 commits into
Closed
Improve build performance with simple hot-path optimizations#1856cpunion wants to merge 19 commits into
cpunion wants to merge 19 commits into
Conversation
(cherry picked from commit 4907ad1)
(cherry picked from commit 54380c6)
(cherry picked from commit 9a88c0c)
(cherry picked from commit 8a04264)
(cherry picked from commit 8f963ba)
(cherry picked from commit 0c14164)
(cherry picked from commit e87e5b3)
(cherry picked from commit 1ba94d4)
(cherry picked from commit 1bf2507)
(cherry picked from commit 4d93cca)
(cherry picked from commit 746ac58)
(cherry picked from commit fefd062)
(cherry picked from commit e2b0386)
(cherry picked from commit 4aa314e)
(cherry picked from commit 27547e4)
Result: {"status":"keep","warm_internal_build_wall":29.279,"go_reported_s":28.415,"baseline_s":31.157,"patched_s":29.279,"delta_s":-1.878,"base_go_reported_s":30.589,"patched_go_reported_s":28.415,"wall_s":29.279}
(cherry picked from commit aebd4c2)
Result: {"status":"keep","warm_internal_build_wall":29.256,"go_reported_s":28.699,"baseline_s":31.312,"patched_s":29.256,"delta_s":-2.056,"base_go_reported_s":30.727,"patched_go_reported_s":28.699,"wall_s":29.256}
(cherry picked from commit f857424)
Result: {"status":"keep","warm_internal_build_wall":29.456,"go_reported_s":28.89,"baseline_s":30.32,"patched_s":29.456,"delta_s":-0.864,"base_go_reported_s":29.756,"patched_go_reported_s":28.89,"wall_s":29.456}
(cherry picked from commit 04e9b01)
Result: {"status":"keep","warm_internal_build_wall":28.574,"go_reported_s":27.996,"baseline_s":30.326,"patched_s":28.574,"delta_s":-1.752,"base_go_reported_s":29.768,"patched_go_reported_s":27.996,"wall_s":28.574}
(cherry picked from commit fd5680f)
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
Closing per decision: CI/build-time benefit is not strong or stable enough to proceed with this build-performance PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This extracts the lower-risk, source-only build performance changes from the larger build-perf branch.
Included changes focus on simple hot-path reductions:
go/ssa.Program.Buildgo list -jsonfor Plan9 asm discovery while preservinginternal/chacha8randstub behaviorlinkMainPkgscratch containersIntentionally excluded from this PR:
The branch does not modify cache archive/manifest generation or cache publication ordering. The only cache-related behavior kept is adding
LLGO_SSA_SANITYto build env inputs when sanity checking is explicitly enabled, so cached artifacts distinguish sanity mode from normal builds.Local timing
Representative paired local runs on darwin/arm64, Go 1.24.11:
go test ./internal/build -run '^TestExtest$' -count=335.621sreported,36.82swall32.356s/32.359sreported,32.88s/32.91swallApprox wall improvement: ~10.6%.
go test ./internal/build -count=148.644sreported,49.17swall43.259s/44.594sreported,43.78s/45.19swallApprox wall improvement: ~8-11%.
Validation
go test ./internal/packages ./internal/build ./internal/crosscompile ./internal/env ./internal/goembed ./ssa ./xtool/env/llvm -count=1go test ./internal/build -run '^TestExtest$' -count=3go test ./test/std/math/rand/v2 ./test/std/reflect -count=1go test ./internal/build -run '^TestPkgSFilesChacha8UsesStubBeforeOtherFiles$|^TestParallelObjectEmit|MainModule|Abi|Reflect' -count=1go build -a -tags=dev -o /tmp/llgo-build-perf-simple ./cmd/llgo