Skip to content

perf(release): link memfast into the linux-x64 tsc - #111

Merged
t3dotgg merged 1 commit into
mainfrom
goport-memfast1b
Oct 28, 2026
Merged

t3dotgg merged 1 commit into
mainfrom
goport-memfast1b

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 28, 2026

Copy link
Copy Markdown
Member

Problem

The linux-x64 tsc that release.yml publishes is static musl. musl's memcmp, bcmp and memchr are byte loops, and its memcpy and memmove use rep movs. They cost a measurable share of a check.

Fix

The release build links lust's memfast.c (MIT, lust-lang src/runtime/memfast.c at 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 with nm that the five __wrap_ symbols are linked.
  • License: licenses/memfast-LICENSE.txt, a NOTICE.md entry, 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:

Without memfast With memfast
Shipped tsc 38,347,584 B 38,349,120 B (+1,536 B)
VS Code wall, default (dbook-lan, 15 rounds) 4,430.65 ms 4,265.91 ms (-3.72%)
Sentry wall 4,412.02 ms 4,221.11 ms (-4.33%)
TypeORM wall 323.12 ms 304.84 ms (-5.66%)

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

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.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: e558de44-ec21-438d-b716-db809925e68b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@t3dotgg
t3dotgg merged commit 0c822c9 into main Oct 28, 2026
23 checks passed
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