[Toc][Index]

Actual versus Effective Compression


ZSPack reports both Actual compression and Effective (parenthetical) 
compression ratios. 
Actual compression ratio is the ratio of the original file size to the 
final compressed file size. 
Effective compression is the ratio of the amount of disk space used to 
store the uncompressed version of the file, compared to the disk space 
used to store the compressed version of the file. 
The difference between Effective and Actual compression ratios arises as 
the disk space is allocated in blocks of bytes, not just bytes as the file 
size is measured. 
The number of bytes in a block is dependant on the underlying File System. 

The HPFS File System always allocates blocks of 512 bytes, while the FAT 
(DOS) File System allocates blocks as follows: 


+------------------------------+------------------------------+
|Partition Size                |Block Size                    |
+------------------------------+------------------------------+
|Less than 16 Mbyte            |4 Kbyte                       |
+------------------------------+------------------------------+
|Less than 128 Mbyte           |2 Kbyte                       |
+------------------------------+------------------------------+
|Less than 256 Mbyte           |4 Kbyte                       |
+------------------------------+------------------------------+
|Less than 512 Mbyte           |8 Kbyte                       |
+------------------------------+------------------------------+
|Less than 1024 Mbyte          |16 Kbyte                      |
+------------------------------+------------------------------+
|Less than 2048 Mbyte          |32 Kbyte                      |
+------------------------------+------------------------------+
|Less than 4096 Mbyte          |64 Kbyte                      |
+------------------------------+------------------------------+


As ZSPack works on a byte basis and the Disk System works on a block 
basis, a difference between Actual and Effective compression can occur. 
 However, this difference will generally only be noticed on smaller files. 
 Obviously then, Effective compression is what counts, as this represents 
the true saving in disk space. 
To further illustrate this situation, consider the following scenario: 
You have a HPFS partition with a file 'letter.doc' occupying 700 bytes. 
 This file is then compressed to 350 bytes.  A 50 percent Actual 
reduction. 
The HPFS File System has a block size of 512 bytes.  Therefore, the file 
would have used 2 blocks (1024 bytes) before compression. 
After compression, the file would occupy 1 block (512 bytes).  Once again 
a 50 percent Effective reduction.  In this case the Actual and Effective 
compression ratios are the same. 
Now consider another file 'letter1.doc' which is 700 bytes in size.  This 
file is then compressed to 500 bytes, a 28 percent Actual reduction. 
As in the previous case, the number of disk blocks used has been reduced 
from 2 to 1, a 50 percent reduction. 
In this case, the Effective compression is greater than the Actual 
compression. 

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs