Skip to content

Add note on Zstd compression levels about memory usage#120639

Open
DeeJayLSP wants to merge 1 commit into
godotengine:masterfrom
DeeJayLSP:zstd-compression-level-note
Open

Add note on Zstd compression levels about memory usage#120639
DeeJayLSP wants to merge 1 commit into
godotengine:masterfrom
DeeJayLSP:zstd-compression-level-note

Conversation

@DeeJayLSP

@DeeJayLSP DeeJayLSP commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Zstandard levels above 19 use more memory, as stated in the zstd command-line tool's --ultra flag, 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.

@DeeJayLSP DeeJayLSP requested a review from a team as a code owner June 25, 2026 14:17
@AThousandShips AThousandShips added this to the 4.x milestone Jun 25, 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a ballpark estimate of "significantly"? Is it something like 2x on average, or more like 5x?

@DeeJayLSP DeeJayLSP Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants