Skip to content

extmod/uzlib: Add gzip compression support. (update to #5613 and #6972)#8195

Closed
harbaum wants to merge 7 commits into
micropython:masterfrom
harbaum:master
Closed

extmod/uzlib: Add gzip compression support. (update to #5613 and #6972)#8195
harbaum wants to merge 7 commits into
micropython:masterfrom
harbaum:master

Conversation

@harbaum
Copy link
Copy Markdown

@harbaum harbaum commented Jan 20, 2022

This is another attempt on #5613 and #6972. It addresses all of the comments and additionally fixes a memory leak.

This has been stress tested with a few GB of video data as seen here.

As a quick test gzip compression can be tested against the already present decompression like so:

>>> import uzlib
>>> uzlib.decompress(uzlib.gzip("Hello World!")[10:-8], -15)
bytearray(b'Hello World!')

@andrewleech
Copy link
Copy Markdown
Contributor

andrewleech commented Jan 21, 2022

FYI I've also updated #5613 few times to include your original commit with a could of improvements etc and have generally been keeping it rebased any time I update my project working branch.

That being said I'm still not sure if it's ideal for inclusion in mainline micropython as-is because the MR and/or underlying library does make a few assumptions that aren't ideal in all cases.

In my understanding, there are a few compromises in terms of ram use vs compression level that would be better customised on a per-project basis depending on the chip / resources available.

Perhaps this would all be much better as a dynamic C module where there could be a couple of versions available for different applications? I still haven't got my head around building/distributing dynamic C modulus properly though to know if this is a good/viable option.

Or maybe it is still better to not let perfection get in the way of good enough... I'm not too sure how much flash/ram is taken up by this current implementation, as a board #define to enable/disable as needed maybe this is good enough.

@dpgeorge dpgeorge added the extmod Relates to extmod/ directory in source label Jan 21, 2022
@dpgeorge
Copy link
Copy Markdown
Member

Superseded by #11905.

@dpgeorge dpgeorge closed this Jul 21, 2023
tannewt added a commit to tannewt/circuitpython that referenced this pull request Aug 24, 2023
…-zlib-docs

8.2.x backport 8125 zlib docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extmod Relates to extmod/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants