Skip to content

Optimize the speed runtime with a committed runtime profile - #2446

Merged
ctate merged 1 commit into
mainfrom
ctate/optimize-speed-runtime-5d5a41
Oct 28, 2026
Merged

ctate merged 1 commit into
mainfrom
ctate/optimize-speed-runtime-5d5a41

Conversation

@ctate

@ctate ctate commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator
  • The LLVM helper instruments, annotates and optimizes the Linux x64 speed runtime units with a committed profile (runtime functions only), refreshed by scripts/refresh-runtime-profile.mjs and checked by tests; release builds are unchanged.
  • tsc-ts checks 0.1% to 6.5% faster at --checkers 1 across nine projects, including the five outside the training set.
  • bench:runtime at --optimization=speed: geomean −4.1%; speed executables are a median 16.5% larger.

The LLVM helper's runtime-unit now optimizes a unit itself (--opt-level),
with IR instrumentation (--profile-generate) or a profile (--profile-use),
through the same pipeline as program code. The Linux x64 pack's speed
units are compiled to unoptimized bitcode and optimized there with
packages/runtime-pack-common/profiles/linux-x64-gnu.profdata.gz, so one
LLVM writes and reads every profile. Release and library flavors are
unchanged. The pack manifest records how the profile matched the units.

Code the runtime profile finds cold is optimized for speed, not size: a
runtime function the training programs rarely call can be hot in another
program. scr_message.c is optimized without the profile.

scripts/refresh-runtime-profile.mjs trains the profile on the runtime
benchmark workloads and, optionally, a tsc-ts checkout, and keeps only the
records of functions the instrumented runtime units define
(merge-profiles --keep-functions). Tests check that the profile still
matches the runtime and names only runtime functions.
@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Oct 28, 2026 1:12am UTC

@ctate
ctate merged commit e585024 into main Oct 28, 2026
78 checks passed
@ctate
ctate deleted the ctate/optimize-speed-runtime-5d5a41 branch October 28, 2026 02:03

This branch was successfully deployed

1 active deployment
Preview — 95e715fe Deployed Oct 28, 2026 by vercel[bot]
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