8000 [WIP] Add zopfli as default program for deflate algorithm by X-Ryl669 · Pull Request #64 · jkent/frogfs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[WIP] Add zopfli as default program for deflate algorithm #64

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

8000
Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

X-Ryl669
Copy link
Contributor
@X-Ryl669 X-Ryl669 commented Sep 5, 2024

Don't merge this PR, since it contains a change that'll break users code.

This PR contains 2 commits. The first one is the a change to match esp-idf convention for idf.py target names.

In esp-idf, all targets you can run use dash for word separation, but frogfs uses underscore for the generate_frogfs_bin target (but not frogfs-flash). So the first commit rename the target to fit esp-idf's conventions (this was spotted by our CI tooling).

However, this is a breaking change for any user of frogfs (although, if they use frogfs-flash, it still works, so I would say it breaks developers of frogfs more).

The second commit is a dumb but useful one. If zopfli is present on the system, it'll use it instead of zlib for deflating the input files. zopfli is more efficient at compressing data while still generating deflate compatible stream (so it'll be decompressed perfectly by zlib or gzip or ...). For an embedded system, this is a simple way to pack more data in the filesystem's partition. If it's not present, it'll fallback to zlib.

I've modified the requirements.txt file to include zopfli so we can test it in our pipeline, but I'm not sure it's right (since it'll force all user to download zopfli). I don't know what you think here?

…vention of using dashes for target and not underscore so it becomes "generate-frogfs-bin"
…duction in file size compared to zlib/deflate
@jkent
Copy link
Owner
jkent commented Sep 5, 2024

I think a way to install dependencies as needed is in order. I'd like to do the same for brotli too. Something similar to how node.js packages are installed on-demand. I toyed with the idea, but there isn't a stable api interface to pip. Maybe multiple requirements.txt files named similar to the transform?

@X-Ryl669
Copy link
Contributor Author
X-Ryl669 commented Sep 6, 2024

I don't know if a os.system('pip install brotli') could work in the same try: import() except: os.system('pip install brotli') import () way. Maybe there's a pythonic way to do so, I don't know.

@X-Ryl669
Copy link
Contributor Author
X-Ryl669 commented Sep 6, 2024

Maybe this module will solve the issue well.

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
0