-
Notifications
You must be signed in to change notification settings - Fork 30.3k
perf(turbo-tasks-backend): use DefaultStorage for AggregationNumber to save memory #88336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(turbo-tasks-backend): use DefaultStorage for AggregationNumber to save memory #88336
Conversation
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
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: **431 kB** → **431 kB** ✅ -10 B82 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
|
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
fc6c9dd to
cf617ff
Compare
fa8d88f to
3ac147f
Compare
| type V = V; | ||
| type Iterator<'l> | ||
| = std::option::IntoIter<(&'l (), &'l V)> | ||
| where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…o save memory Replace `OptionStorage<AggregationNumber>` with `DefaultStorage<AggregationNumber>` in InnerStorage and InnerStorageSnapshot. DefaultStorage stores the value directly without an Option wrapper, using `Default::default()` to represent "empty". This saves 4 bytes per value: - DefaultStorage<AggregationNumber>: 12 bytes (same as AggregationNumber itself) - OptionStorage<AggregationNumber>: 16 bytes (12 + 4 for Option tag) This is semantically correct because AggregationNumber's default value (base=0, distance=0, effective=0) represents a non-aggregating leaf node, which is equivalent to "not set" in the aggregation system. The overall InnerStorage size remains 128 bytes due to alignment, but this matches common allocator bucket sizes meaning no wasted space from internal alignment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
3ac147f to
76a15d8
Compare
cf617ff to
3f6698f
Compare
3f6698f to
0e3181f
Compare
Merge activity
|

This drops the size of the
aggregation_numberfield from 16 to 12 bytes which allows the fullInnerStoragestruct to do from 136 bytes to 128 bytes (thanks alignment!)Due to allocator behavior this is probably saving more like 32 bytes per InnerStorage allocation, see mimalloc size classes