perf(ecmascript): SlimVec experiment — 32B JsValue without shrink_to_fit
Codspeed flagged +4.73% on app-page-turbo for the Box<[T]> variant, pointing at the `shrink_to_fit` realloc in `Vec::into_boxed_slice` as the likely instruction-count cost. This commit introduces `SlimVec<T>` — a 16 B (ptr + u32 len + u32 cap) Vec variant. Same size as `Box<[T]>` but conversion from `Vec` is O(1) no-op (keeps the original capacity instead of shrinking). Swaps `Box<[T]>` out of `Call`/`New` args for `SlimVec<T>`, and adds the `Unknown.reason` Cow → &'static str shrink on top to bring `JsValue` to 32 B. Goal: get 32 B JsValue + no shrink_to_fit instruction-count hit. Pushing to see Codspeed's verdict; local wall-clock is a bit noisy around here.
Showing
Please
register
or
sign in
to comment