-
Notifications
You must be signed in to change notification settings - Fork 150
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
Use bz2 or lzma for python >= 3.3 ? #247
Comments
Certainly not by default on any Python, and PyPI may consider refusing such wheels. |
The second idea sounds a bit safer. Do you have numbers for this? |
Hi @agronholm The
I combined the |
Wheels are zipfiles which are compressed per-file, and the zip metadata (filenames) is not compressed. If you were to create the zip file with no compression "store" and then lzma the whole thing you would see better results. Compression algorithms work better on large inputs. |
Yeah, there are bound to be practical difficulties with compression other than zlib. |
I like the idea of improving compression, does it make sense to only use zlib forever, but you'd have to update more tools than just bdist_wheel to pull it off. |
I've done some groundwork for this in PR #316. Once I am sure that PyPI will reject bzip2/lzma based wheels, I can add support for other compression algorithms as well. |
Cool. It's sortof good and probably helpful for the few wheels that have big individual files.
|
@agronholm, will PyPI reject bzip2/lzma? may I know the reason? I am trying to reduce binary size for our wheel, and LZMA shows good potential. |
Those are not supported on Python 2, and thus historically wheels did not support it. Going forward, the plan seems to be to have two layers in the zip where the actual content is xz compressed, making it even more efficient. |
Thanks for the quick response. But if my package only targets for Python 3, will there be any blocking issue to upload my wheel to PyPI and let user install my package via pip3? |
I honestly don't know. I know it's not supported or recommended. |
Got it, thanks. |
Hi,
python >= 3.4
, if a wheel is only for python3.X, it could reduce the size by usingbz2
orlzma
.Typical example :
numpy-1.15.0-cp37-cp37m-manylinux1_x86_64.whl
(size: 13845063 bytes), only forpython 3.7
, could gain 50% by usinglzma
(size: 6899142 bytes)..zlib
, starting withpython 3.7
,zipfile
exposes thecompresslevel
param.When wheels are generated from
python 3.7
, it could also help to setcompresslevel
to a value higher than 6.Thanks !
The text was updated successfully, but these errors were encountered: