[issue17004] Expand zipimport to include other compression methods

Serhiy Storchaka report at bugs.python.org
Sun Jan 20 21:32:22 CET 2013


Serhiy Storchaka added the comment:

Here are some tests.

time 7z a -tzip -mx=0 python-0.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z a -tzip python.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z a -tzip -mx=9 python-9.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z a -tzip -mm=bzip2 python-bzip2.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z a -tzip -mm=bzip2 -mx=9 python-bzip2-9.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z a -tzip -mm=lzma python-lzma.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z a -tzip -mm=lzma -mx=9 python-lzma-9.zip $(find Lib -type f -name '*.py') >/dev/null
time 7z t python-0.zip >/dev/null
time 7z t python.zip >/dev/null
time 7z t python-9.zip >/dev/null
time 7z t python-bzip2.zip >/dev/null
time 7z t python-bzip2-9.zip >/dev/null
time 7z t python-lzma >/dev/null
time 7z t python-lzma.zip >/dev/null
time 7z t python-lzma-9.zip >/dev/null
wc -c python*.zip

Results:

             pack* unpack   size
             time   time    (MB)
store         0.5    0.2   19.42
deflate         6    0.4    4.59
deflate-max    40    0.4    4.52
bzip2           6    2.1    4.45
bzip2-max      79    2.0    4.39
lzma           37    0.7    4.42
lzma-max       62    0.7    4.39

*) For pack time I take user time because 7-zip well parallelize deflate and bzip2 compression.

As you can see, a size difference between maximal compression with different methods only 3%. lzma decompress almost twice slower then deflate, and bzip2 decompress 5 times slower. Python files are too small to get benefit from advanced compression.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17004>
_______________________________________


More information about the Python-bugs-list mailing list