Add note on Zstd compression levels about memory usage#120639
Open
DeeJayLSP wants to merge 1 commit into
Open
Conversation
Calinou
reviewed
Jun 26, 2026
| </member> | ||
| <member name="compression/formats/zstd/compression_level" type="int" setter="" getter="" default="3"> | ||
| The default compression level for Zstandard. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. | ||
| [b]Note:[/b] Levels above [code]19[/code] require significantly more memory during compression and decompression. |
Member
There was a problem hiding this comment.
Is there a ballpark estimate of "significantly"? Is it something like 2x on average, or more like 5x?
Contributor
Author
There was a problem hiding this comment.
This source claims level 19 has a window size of 8MB. That size increases to 32MB, 64MB and 128MB in levels 20, 21 and 22, respectively.
Which means level 20 will allocate 4x more memory than level 19. Level 22 allocates 16x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zstandard levels above 19 use more memory, as stated in the
zstdcommand-line tool's--ultraflag, which unlocks their usage. Source.Delta Encoding already has a note about levels above 19, so I think it's fair the project settings have it too.