Skip to content

[pull] canary from vercel:canary#881

Merged
pull[bot] merged 3 commits intocode:canaryfrom
vercel:canary
Mar 15, 2026
Merged

[pull] canary from vercel:canary#881
pull[bot] merged 3 commits intocode:canaryfrom
vercel:canary

Conversation

@pull
Copy link

@pull pull bot commented Mar 15, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

mmastrac and others added 3 commits March 14, 2026 12:49
# What

Add `lto = "thin"` to the workspace-level `[profile.release]` in
`Cargo.toml`.

# Why

Thin LTO enables cross-crate optimization at link time, improving
runtime
performance of the final artifacts (next-napi-bindings native module,
turbopack-cli binary, and benchmarks) without the full build time cost
of
fat LTO.

# How

Added `lto = "thin"` to the workspace root `[profile.release]` section.
This applies to all release-profile link targets in the workspace,
including
binaries, cdylibs, and benchmarks. The `release-with-assertions` and
`release-with-debug` profiles inherit from `release`, so they also
benefit.
# What

Make a significant chunk of the remaining turbotask registration code
(Values, Traits and Value/Trait impls) `const`. The vtable lookup for
trait methods is constructed at compile time, allowing us to look up a
trait's implementation in near-constant time.

Introduces a new, common RegistryType we use for Values, Traits and
Functions to reduce duplication. We still have a Lazy guard on each
registry, but that will probably be removed if we migrate to distributed
slices.

NOTE: This removes a number of Lazy guards, but not all of them to avoid
making the PR too large. The next pass of PR will remove the remaining
Lazy guards, where possible.

# Why

By making this code `const`, we reduce the overall init time of the
executable, make LTO a little more powerful (when we end up using that),
reduce startup allocations, and reduce the amount of time we spend
checking Lazy atomics.

In hyperfine tests of the benchmark-apps folder, we see a 1% to 3%
speedup for compilation.
@pull pull bot locked and limited conversation to collaborators Mar 15, 2026
@pull pull bot added the ⤵️ pull label Mar 15, 2026
@pull pull bot merged commit 0f59973 into code:canary Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants