mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Ability to clone/serialize/deserialize state in Compressor and Decompressor #469
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bergkvist on GitHub (Jul 5, 2023).
I have a lot of similar files which I want to compress individually. I have noticed however that I can get a much better compression ratio (typically 5x extra) by first processing some training data with the same compressor/decompressor.
Ideally I would want to be able to do something like this:
I have tried using
copy.deepcopy, but this fails withTypeError: cannot pickle 'brotli.Compressor' object.@eustas commented on GitHub (Jul 6, 2023):
I believe, solution for this is not serializtion/deserialization, but using extra dictionaries. Native and Java API have this feature. Python and Go do not have such bindings yet. Hopefully will add them soon.
@bergkvist commented on GitHub (Jul 31, 2023):
Has support for dictionaries in Python been added now? Since this was closed?
@eustas commented on GitHub (Jul 31, 2023):
Not yet, but we are moving towards that. If you like to have that tracked, lets create an issue that reflects our intention.
@bergkvist commented on GitHub (Jul 31, 2023):
Okay, I created an issue for that now (https://github.com/google/brotli/issues/1052) - feel free to edit/link PRs/issues as appropriate