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

add derive(Serialize, Deserialize) to DecompressorOxide #166

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dishmaker
Copy link

Fixes

I know this PR will not be merged, but it proves that state saving is actually possible!

Entire DecompressorOxide state compresses into only 356 bytes, for simple test case.

partial read len=32768
save at in_pos=11729
[miniz_oxide/tests/test_serde.rs:57:5] decompressor_state_msgpack.len() = 11824
[miniz_oxide/tests/test_serde.rs:58:5] decompressor_state_compressed.len() = 356
resume at in_pos=11729

So fast-seekable zip files are possible 😄

@oyvindln
Copy link
Collaborator

Could you leave leave the black_box change out of this PR? I would like to evaluate that separately.

I think adding a serde feature could be fine if there is a use for it though I would prefer if it's not enabled by default. Is it also possible to only enable the rmp_serde dev dependency conditionally?

@dishmaker dishmaker force-pushed the dishmaker/save_restore_decomp branch from 47ea42a to 36bd9da Compare February 20, 2025 12:34
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.

2 participants