Skip to content

chore(cache): disable unused zstd default features - #828

Draft
fengmk2 wants to merge 1 commit into
mainfrom
chore/zstd-default-features
Draft

fengmk2 wants to merge 1 commit into
mainfrom
chore/zstd-default-features

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 10, 2026

Copy link
Copy Markdown
Member

Motivation

vt depends on zstd with its default features (legacy, arrays, zdict_builder). The cache only streams archives that vt writes itself through zstd::Encoder and zstd::Decoder, including the ones restored from a remote cache. It never decodes the pre-1.0 zstd frame formats, builds dictionaries, or uses the array helpers. The legacy decoders were still linked, because libzstd's streaming decoder calls them whenever legacy support is compiled in.

This matches astral-sh/uv#22242, which disabled unused Zstandard support in uv-build.

Disabling the defaults shrinks the Vite+ NAPI binding (vite-plus-cli --features rolldown, release profile, darwin-arm64) from 42,115,952 to 41,950,544 bytes, a 165,408-byte (0.39%) reduction. The baseline patches an unmodified vite-task checkout into vite-plus the same way. Only zstd-safe/std remains enabled, and Cargo.lock is unchanged. Vite+ picks this up with its next vite-task bump.

🤖 Generated with Claude Code

The cache only streams archives that vt writes itself, so zstd's default
`legacy` decoders (pre-1.0 frame formats), `zdict_builder`, and `arrays`
features are never used. The legacy decoders were still linked because
libzstd's streaming decoder calls them whenever legacy support is
compiled in. Disabling the defaults removes 165,408 bytes from the
Vite+ NAPI binding on darwin-arm64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.75%  [ -8.19% ..  +9.73%]  overhead   +55.64%
dynamic/access             change  +0.18%  [ -4.02% ..  +4.48%]  overhead    +9.11%
dynamic/access-relative    change  +0.46%  [-10.44% .. +11.99%]  overhead   +48.23%
dynamic/access-contended   change  +1.33%  [ -2.32% ..  +6.58%]  overhead   +11.10%
static/launch              change  +0.32%  [ -5.54% ..  +7.91%]  overhead  +170.33%
static/access              change  -0.23%  [ -6.28% ..  +3.81%]  overhead  +719.41%
static/access-relative     change  +0.78%  [ -5.80% ..  +6.41%]  overhead +1222.33%
static/access-contended    change  -1.18%  [-11.44% ..  +4.75%]  overhead +2110.63%

macos

dynamic/launch             change  +0.23%  [ -6.26% ..  +8.61%]  overhead  +232.23%
dynamic/access             change  +0.90%  [-13.88% .. +19.81%]  overhead    +3.59%
dynamic/access-relative    change  -0.12%  [-32.54% .. +40.91%]  overhead  +269.85%
dynamic/access-contended   change +10.53%  [-12.50% .. +133.98%]  overhead    +2.99%

windows

dynamic/launch             change  -0.09%  [ -2.65% ..  +1.91%]  overhead   +25.04%
dynamic/access             change  +0.00%  [ -0.92% ..  +0.75%]  overhead    +1.17%
dynamic/access-relative    change  -0.18%  [ -0.91% ..  +0.92%]  overhead    +1.13%
dynamic/access-contended   change  +0.19%  [ -1.41% ..  +1.10%]  overhead    +1.45%

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant