wqweto / ZipArchive

A single-class pure VB6 library for zip with ASM speed
MIT License
55 stars 23 forks source link

Compression file size #11

Open RichardKimJH opened 5 years ago

RichardKimJH commented 5 years ago

Thank you for the good code.

I tested it with the attached sample program.

The compressed file is slightly larger than the Windows default compression.

Is there a reason?

wqweto commented 5 years ago

The ASM thunk compressor uses only static Huffman trees. You can read this and this comment in original PuTTY sshzlib.c source.

I might add dynamic tree in the future "borrowing" implementation from libdeflate but currently the incentive is not very great unless someone provides a Pull Request with this implemented.

I'll post an issue now tracking progress on dynamic Huffman trees.

tannerhelland commented 5 years ago

Alternatively, what about a compile-time option to just use libdeflate instead of the thunk for deflate/inflate tasks? Just make the caller supply a path to libdeflate.dll, and use a tiny DispCallFunc wrapper for the relevant declares.

Obviously this defeats the "one file" nature of cZipArchive, but libdeflate is a tiny dependency (52 kb as of v1.2) and the benefits to deflate speed, deflate ratio, and inflate speed would be enormous. cZipArchive would then produce zip files with smaller size (and better perf) than e.g. Shell32 zip wrappers.

(This suggestion is nakedly selfish as I already use libdeflate across a variety of projects, but cZipArchive is still my preferred choice for zip file management in VB6. Combining the two would be perfection IMO!)

wqweto commented 5 years ago

I'll post an issue tracking progress on the conditional compilation for libdeflate [de]compressor dependency then :-))