Skip to content

Add KB entry 043: buying compressed size with a fixed speed budget in zstd - #26

Open
HenningWoydt wants to merge 1 commit into
CHSZLab:mainfrom
HenningWoydt:kb/043-zstd-size-fixed-speed-budget
Open

HenningWoydt wants to merge 1 commit into
CHSZLab:mainfrom
HenningWoydt:kb/043-zstd-size-fixed-speed-budget

Conversation

@HenningWoydt

Copy link
Copy Markdown

Adds knowledge-base entry 043 and its row in INDEX.md.

The entry comes from an AAE session on the reference Zstandard library that reduced compressed size at levels 1 and 19 under a fixed speed budget (speed score at most 1.0 against the unmodified code), checked by a held-out gate. Size went from 1.000 to 0.948 (level 1 -9.9%, level 19 -0.2%), at a speed score of 0.947.

Transferable lessons:

  • Price levers by size per unit of time: the fast level was far from its speed/size frontier, the strong level close to it.
  • Lazy check from the overwritten hash slot: the fast match finder reads the slot of the next position anyway just before overwriting it, so comparing its match costs one compare (-1.6% level-1 size at +2.5% time). A second step with an early table load gives a further -0.9%.
  • Distance-aware candidate choice (from brotli and xz): in zstd the best weight was a quarter byte of length per offset bit, far below brotli's.
  • Cheap insertions: positions near the end of each match are the best extra hash insertions.
  • Hidden-set budget: a tuning-set speed score overstated the held-out budget, and changes that move time into the decoder fail it.
  • Code placement: on this CPU it bought speed budget to spend on size.

Number 043 because the open PRs #23 and #24 already claim 041 and 042. PR #25 (also numbered 041) may need renumbering.

… zstd

Lazy checks in the fast match finder from the overwritten hash slot, match-end
insertions, distance-aware candidate scoring taken from brotli and xz, faster
statistics adaptation in the optimal parser, and code placement to buy speed
budget. Size 1.000 -> 0.948 at a speed score of 0.947 vs unmodified.

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