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

68 lines
1.9 KiB
TOML

[package]
name = "turbo-tasks"
version = "0.1.0"
description = "TBD"
license = "MIT"
edition = "2024"
[lib]
bench = false
[features]
default = []
tokio_tracing = ["tokio/tracing"]
hanging_detection = []
task_id_details = []
task_dirty_cause = []
verify_determinism = []
# TODO(bgw): This feature is here to unblock turning on local tasks by default. It's only turned on
# in unit tests. This will be removed very soon.
non_operation_vc_strongly_consistent = []
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
auto-hash-map = { workspace = true }
bincode = { workspace = true }
concurrent-queue = { workspace = true }
dashmap = { workspace = true }
either = { workspace = true }
erased-serde = { workspace = true }
event-listener = "5.4.0"
futures = { workspace = true }
indexmap = { workspace = true, features = ["serde"] }
parking_lot = { workspace = true, features = ["serde"]}
pin-project-lite = { workspace = true }
rayon = { workspace = true }
regex = { workspace = true }
rustc-hash = { workspace = true }
scattered-collect = { workspace = true }
serde = { workspace = true, features = ["rc", "derive"] }
serde_json = { workspace = true }
shrink-to-fit = { workspace = true, features = ["indexmap", "serde_json", "smallvec", "nightly"] }
smallvec = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tokio-util = { workspace = true }
tracing = { workspace = true }
triomphe = { workspace = true, features = ["unsize", "unstable"] }
turbo-bincode = { workspace = true }
turbo-dyn-eq-hash = { workspace = true }
turbo-frozenmap = { workspace = true }
turbo-rcstr = { workspace = true }
turbo-tasks-hash = { workspace = true }
turbo-tasks-macros = { workspace = true }
turbo-tasks-malloc = { workspace = true }
unsize = { workspace = true }
[dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] }
[[bench]]
name = "mod"
harness = false