Files
Luke SandbergandGitHub aaf2fe3d58 [turbopack] Optimize the implementation of AutoMap/AutoSet
(#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
2026-07-14 16:35:00 -07:00

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