List Archive

Thread

Thread Index

Message

From: Boaz Stolk <bstolk%aweta.nl@localhost>
To: "libzip-discuss%nih.at@localhost" <libzip-discuss%nih.at@localhost>
Subject: compression and speed
Date: Tue, 29 Mar 2016 14:00:35 +0000

Hi!

 

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?

 

Regards,

 

Boaz

 

$ time zip out_zip.zip source.bin

  adding: source.bin (deflated 47%)

 

real 0m1.675s

user 0m1.059s

sys  0m0.616s

$ time ziptool out_libzip.zip add_file source.bin source.bin 0 17856084

 

real 0m4.308s

user 0m4.027s

sys  0m0.277s

 

$ time python -c "import zipfile; zf = zipfile.ZipFile('out_py.zip', 'a', zipfile.ZIP_DEFLATED); zf.write('source.bin'); zf.close()"

 

real 0m1.701s

user 0m1.246s

sys  0m0.444s

 

Made by MHonArc.