COMPRESSIONS
Modern Pascal added 5 different native compression algorithms. These are not commercial programs, instead, they are individual compression theories. Some are extremely fast but do not produce the smallest result. While others produce extremely small results, but take a little longer to do so. Our .wet (Wet) compression script using the LH6 compression algorithm that I have tweaked to produce the best compression over 99.9% of the time - however, it is not written in assembly, so it is not the fastest. All of our compression algorithms are lossless - so they are perfect for data, which is our primary application focus.For a benchmark test, the 5 supported compression theories were tasked with compressing the full Mac Beth play in plain ASCII HTML formatted text (just shy of 200,000 bytes. Here are the results:
- LH6 - 72.34% smaller in 230ms (next to slowest, best compression)
- LZW - 69.56% smaller in 266ms (slowest, next to best compression)
- LZ - 60.15% smaller in 226ms (middle speed, middle compression)
- BH - 33.87% smaller in 150ms (next to fastest, worst compression)
- SYN - 59.96% smaller in 143ms (fastest, middle compression)
The next test, a Linux btmp file (29,915,136 bytes) - this task is how well the algorithms handle a large file that has very minimal plain ASCII bytes. In brackets, I display the new file size, just so it is clear what the size differences equate to on 30mb.
- SYN - 95.02% [149k] smaller in 526ms (fastest, next to best compression)
- BH - 79.63% [609k] smaller in 898ms (next to fastest, worst compression)
- LH6 - 95.04% [148k] smaller in 84,224ms (middle speed, best compression)
- LZW - 94.03% [178k] smaller in 12 minutes and 45,546ms (next to slowest, middle compression)
- LZ - 94.14% [175k] smaller in 74 minutes and 33,710ms (slowest, middle compression)
Globals
Functions
Procedures
LH6Compress(InSource:String;Var OutData:String) LH6Decompress(InSource:String;Var OutData:String) BHCompress(InSource:String;Var OutData:String) BHDecompress(InSource:String;Var OutData:String) LZCompress(InSource:String;Var OutData:String) LZDecompress(InSource:String;Var OutData:String) LZWCompress(InSource:String;Var OutData:String) LZWDecompress(InSource:String;Var OutData:String) SynCompress(InSource:String;Var OutData:String) SynDecompress(InSource:String;Var OutData:String)