mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
(#95694) Optimize the implementation of AutoMap/AutoSet. Previously the `List` variant was backed by a `SmallVec` in inline mode, which needs at least 24 bytes of header (`len`, `cap`, `ptr` — all `usize`) even though the list never holds more than 32 elements. This replaces it with the `TinyVec` struct from turbo-tasks-backend which is now enhanced with support for an `inline` array. The length is a `NonZeroU8`, which reserves a niche the `AutoMap` enum folds its discriminant into — dropping `AutoMap`'s minimum size to 16 bytes. This in turn shrinks `TaskStorage` and the `LazyField` enum. Some inline structs in TaskStorage are increased in size so we keep the 128 byte footprint
25 lines
520 B
TOML
25 lines
520 B
TOML
[package]
|
|
name = "auto-hash-map"
|
|
version = "0.1.0"
|
|
description = "TBD"
|
|
license = "MIT"
|
|
edition = "2024"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
bincode = { workspace = true }
|
|
hashbrown = { workspace = true, features = ["serde"]}
|
|
rustc-hash = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
shrink-to-fit = { workspace = true, features = ["hashbrown"] }
|
|
|
|
[dev-dependencies]
|
|
criterion = { workspace = true }
|
|
turbo-tasks-malloc = { workspace = true }
|
|
|
|
[[bench]]
|
|
name = "tiny_vec"
|
|
harness = false
|