Skip to content

Place functions too large to inline by their own name - #1283

Merged
ctate merged 3 commits into
mainfrom
ctate/place-functions-too-0b59b4
Oct 19, 2026
Merged

ctate merged 3 commits into
mainfrom
ctate/place-functions-too-0b59b4

Conversation

@ctate

@ctate ctate commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator
  • The helper's partitioner no longer keeps a function above 256 KiB of LLVM text with its only caller, so a program's module initializers no longer share the entry point's partition.
  • three.js nodes native, with class-bag-prototype: helper 1:36 → 1:25, test 311 → 289 s.

The helper keeps an internal function that exactly one other function
references in its referrer's partition, so the partition can inline it.
A program's module initializers are each called only from the entry
point, so all of them, with every single-use helper they call, shared
the entry point's partition. In the three.js nodes fixture that
partition held 1.1 million lines of LLVM IR, almost five times the
average, and set the native build's longest compile.

A function whose body is larger than 256 KiB of LLVM text is past
LLVM's inline cost limit even for the only call to a local function, so
it is now placed by the hash of its own name. Its own single-use
callees still stay with it.
@vercel

vercel Bot commented Oct 18, 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 18, 2026 9:33pm UTC

@ctate
ctate merged commit 7b2b864 into main Oct 19, 2026
75 checks passed
@ctate
ctate deleted the ctate/place-functions-too-0b59b4 branch October 19, 2026 00:30

This branch was successfully deployed

1 active deployment
Preview — 82732a75 Deployed Oct 18, 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