Turboopack: put import attributes behind a pointer, 23% faster analyze#91347
Turboopack: put import attributes behind a pointer, 23% faster analyze#91347
Conversation
canary:
references/jsonwebtoken.js/full
time: [63.250 ms 63.918 ms 64.752 ms]
change: [-5.2380% -3.0074% -0.8753%] (p = 0.01 < 0.05)
Change within noise threshold.
Found 12 outliers among 100 measurements (12.00%)
5 (5.00%) high mild
7 (7.00%) high severe
now:
references/jsonwebtoken.js/full
time: [49.070 ms 49.166 ms 49.273 ms]
change: [-24.097% -23.079% -22.237%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Tests Passed |
Merging this PR will improve performance by 25.6%
Performance Changes
Comparing Footnotes
|
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: **408 kB** → **408 kB** ✅ -19 B80 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
| r.issue_source | ||
| .unwrap_or_else(|| IssueSource::from_source_only(source)), | ||
| r.annotations.clone(), | ||
| r.annotations.as_ref().map(|a| (**a).clone()), |
There was a problem hiding this comment.
Doesn't a simple clone work here?
There was a problem hiding this comment.
this does the Option<Arc<ImportAttributes>> to Option<ImportAttributes> conversion
| pub module_path: Wtf8Atom, | ||
| pub imported_symbol: ImportedSymbol, | ||
| pub annotations: ImportAnnotations, | ||
| pub annotations: Option<Arc<ImportAnnotations>>, |
There was a problem hiding this comment.
Would a Box instead of Arc be better?
There was a problem hiding this comment.
Arc:
references/jsonwebtoken.js/full
time: [47.028 ms 47.163 ms 47.306 ms]
change: [-2.4739% -1.5284% -0.6681%] (p = 0.00 < 0.05)
Change within noise threshold.
Box:
references/jsonwebtoken.js/full
time: [48.934 ms 49.123 ms 49.358 ms]
change: [+3.6630% +4.1558% +4.7521%] (p = 0.00 < 0.05)
Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
8 (8.00%) high mild
3 (3.00%) high severe

The JS analyze microbenchmark got 23% faster:
Only a tiny fraction of imports have annotations, be it
import ... with {...}orrequire(/*webpackIgnore: true*/...), so aOption<Pointer<Struct>>mkes sense here.This came up in #91278 (comment), which added another (tiny) field to ImportAttributes. But it caused a 6% regression in the microbenchmark anyway.