Repository navigation
perf(release): link memfast into the linux-x64 tsc - #111
Merged
Merged
Conversation
The static musl linux-x64 tsc used musl's memcpy, memmove, memcmp, bcmp and memchr: byte loops and rep movs. The release build now links lust's memfast.c (MIT, lust-lang 6ced2b86) through --wrap for those five functions. A release check proves the __wrap_ symbols are linked. No Rust source change, no BOLT.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
Problem
The linux-x64 tsc that
release.ymlpublishes is static musl. musl'smemcmp,bcmpandmemchrare byte loops, and itsmemcpyandmemmoveuserep movs. They cost a measurable share of a check.Fix
The release build links lust's
memfast.c(MIT, lust-langsrc/runtime/memfast.cat 6ced2b86) in place of those five functions, through-Wl,--wrap. This is the memfast part of #106 without BOLT, on top of the strip and ICF recipe from #110.crates/ts_goport/scripts/memfast.c,memfast.sh: the C file and its build script.release.yml: builds the object, links it into the linux-x64 PGO tsc, and checks withnmthat the five__wrap_symbols are linked.licenses/memfast-LICENSE.txt, aNOTICE.mdentry, and the npm notice.No Rust source change, no new crate, no unsafe Rust.
Measured
Same R249 source, same PGO profile, static musl, noembed, lld ICF, stripped:
Single-thread instructions: Query -1.01%, Hono -1.50%, Zod -0.22%, Effect -1.28%, VS Code -3.60%, Sentry -2.47%, TypeORM -5.70%, VS Code emit -2.22%. Output (diagnostics, exits, emitted trees) is equal on every cell and on all 1,993 PGO training outputs.
Built and measured by GPT-6.1 Sol and checked by Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code