• Welcome to Jose's Read Only Forum 2023.


Started by MikeTrader, January 14, 2008, 04:36:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


have you ever looked at the Zlib compression code?

I was searching thu this and could not find the c file with the compression algo in it, but I am wondering if they coded it in ASM?

I know this is more of a substantial project but if you are taking suggestions for projects, this would be high up on my list.

In my experimentation:
QuoteSome other Compression Algos I tested on an average record of 2k Bytes:

' Comparison with popular compression Algos:
' Arithmetic  2125 bytes Packed TO 1115 bytes (52.47%) IN 12,757,088 Clks,  UnPacked TO 2125 bytes IN 64,952,000 Clks
' Huffman     2125 bytes Packed TO 1040 bytes (48.94%) IN 748,805 Clks,     UnPacked TO 2125 bytes IN 833,654 Clks
' LZ78        2125 bytes Packed TO 1114 bytes (52.42%) IN 2,248,681 Clks,   UnPacked TO 2125 bytes IN 340,093 Clks
' SuperTiny   2125 bytes Packed TO 702  bytes (33.04%) IN 199,593 Clks,     UnPacked TO 2125 bytes IN 125,644 Clks
' LZ77/LZSS   2125 bytes Packed TO 310  bytes (14.59%) IN 7,398,957 Clks,   UnPacked TO 2125 bytes IN 1,719,175 Clks
' ZLIB:       2125 bytes Packed TO 75   bytes (3.53%)  IN 669,251 Clks,     UnPacked TO 2125 bytes IN 21,854 Clks

The unpack is not as relevant and quite fast, but the Pack could use some help.

Donald Darden

The type of data being compressed has a significant bearing on how much compression is possible.  If your record consisted of all spaces, or all zeros, or some highly repetitious data, it could be made quite small.  On the other hand, if you are compressing random binary data, or any type of data that is not given to repetition or duplication, the compression rate might be less than 10 percent.

Efforts to pack data means looking ahead and attempting to determine whether it is compressible and by what method.  One approach is to attempt to compress it by several methods, then select the one that gives it the highest compression ratio.  This means a lot of extra effort is required during the pack process than is required during the unpack process.  The unpack process is merely given the type of compression used, and reverses the process, which is far less effort than the pack process required.

The time to pack a compressed file is generally considered relatively trivial.  The smaller a file, the less disk space required, and the less time required to transfer the file from one place to another.  The time required to unpack a file is often of greater importance, simply because many people might end up unpacking the file, or you might unpack an archive many times compared to the one time that you needed to make it. 

Charles Pegge

Mike, I am relieved to find an Assembler version of zlib1.dll. I dont think it's a full release yet but at least someone is making it their vocation.



- Latest assembly code for zLib 1.22, both 32 bits (x86) and 64 bits (x86-64 for AMD64/Intel EM64T).


Great news.
I am not sure how to compile this tho... Do  I need a M$ ASM compiler?