Reduce allocations in the next_debug_instant_stack transform#93222
Merged
lukesandberg merged 5 commits intocanaryfrom Apr 27, 2026
Merged
Reduce allocations in the next_debug_instant_stack transform#93222lukesandberg merged 5 commits intocanaryfrom
lukesandberg merged 5 commits intocanaryfrom
Conversation
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: e17e8e7 |
Contributor
Tests PassedCommit: e17e8e7 |
liufang88789-ui
left a comment
There was a problem hiding this comment.
Solid perf work. Hoisting the regex to DebugInstantStack::new() and calling .get_pass() per file is the right split — the expensive compilation happens once, and each transform pass just clones the pre-compiled Regex.
The page_extensions Vec → Vc<Vec> change is the other half of the win. Cloning page_extensions for every ModuleRule was wasteful; now it's a Vc reference that turbopack tracks as a task dependency. Looks like this pattern is consistent with how other turbopack modules handle such data.
mischnic
approved these changes
Apr 27, 2026
Contributor
Author
Merge activity
|
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.

This was allocating a regex on every transform, we can hoist that regex up to avoid the work
I noticed this as a major source of temporary allocations in a dev benchmark
also avoid a bunch of tiny string copies