compression and speed,
- Re: compression and speed, Thomas Klausner (2016/03/29 15:00:20)
What is the reason for libzip’s poor performance when compressing/closing an archive?
I did some tests and compared the results of the default zip tool on my system (from Info-ZIP) with the libzip provided tool ‘ziptool’ and a Python script.
The difference surprised me; libzip is about 2.5 times slower than both Info-ZIP and Python!
Since all three use zlib for DEFLATE compression, how can this big difference be explained? Is libzip really that slow!? Can this be reproduced?
$ time zip out_zip.zip source.bin
adding: source.bin (deflated 47%)
$ time ziptool out_libzip.zip add_file source.bin source.bin 0 17856084
$ time python -c "import zipfile; zf = zipfile.ZipFile('out_py.zip', 'a', zipfile.ZIP_DEFLATED); zf.write('source.bin'); zf.close()"
Made by MHonArc.