Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible Zstandard decompression improvements #14702

Closed
dweiller opened this issue Feb 21, 2023 · 3 comments
Closed

possible Zstandard decompression improvements #14702

dweiller opened this issue Feb 21, 2023 · 3 comments
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@dweiller
Copy link
Contributor

dweiller commented Feb 21, 2023

There are a few things that were explicitly not done in the initial Zstandard decompression PR that may be desired improvements. This issue is to collect them (and others that pop up in between) for future reference in a pre-1.0 stdlib review or to list them incase someone to tackle them earlier.

  • The current implementation does not decode 4-stream literal sections in parallel in order to avoid memory allocations (or remove a need for an additional 128KiB of memory) in the non-allocating API. This presumably sacrifices decompression performance, but benchmarking may be needed to assess what the impact is in practice. This change would require re-working the block decoding in lib/std/compress/zstandard/decode/block.zig to eagerly decode literals into an extra internal buffer.
  • Reuse allocations between frames in std.compress.zstd.decompress.decodeAlloc() API). The frame window could be re-used between frames (provided it is large enough). The relevant allocation is here.
  • a few issue we found may result in minor updates to the zstandard spec - issues found while fuzzing to compare behaviour of Zig decoder to this repo facebook/zstd#3508 is the main upstream issue that will hopefully link to any related changes that get made.
@dweiller dweiller changed the title Zstandard decompression improvements possible Zstandard decompression improvements Feb 21, 2023
@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. standard library This issue involves writing Zig code for the standard library. labels Apr 10, 2023
@andrewrk andrewrk added this to the 0.13.0 milestone Apr 10, 2023
@andrewrk
Copy link
Member

This is a meta-issue. The next step is to extract from it individual issues and then close this one.

@dweiller
Copy link
Contributor Author

dweiller commented Mar 10, 2024

This is a meta-issue. The next step is to extract from it individual issues and then close this one.

The first point in the list is really reminder/note to consider when work is put into benchmarking and performance optimisation. Is it appropriate to extract a 'performance optimisation and benchmarking' issue from and move that note into it, or is that just another meta-issue and only the latter two points should be extracted to individual issues?

@dweiller
Copy link
Contributor Author

Extracted the list above into separate issues.

@andrewrk andrewrk modified the milestones: 0.15.0, 0.12.0 Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

2 participants