How does “Word Size” affect compression

7-zip

In 7 Zip when adding a folder to an archive there is the option to change the Word Size.

How does this word size affect compression, in particular the final size of the zip?

I noticed that changing the compression level increases the word size, however even on ultra it only selects a word size of 128 even though the largest option is over double that. Is there a reason why ultra doesn't select the largest? Is optimal compression size somewhere between the biggest and smallest word size?

Best Answer

It really depends on the data you're compressing and the algorithm used.

Word size

Enter the length of words, which will be used to find identical sequences of bytes for compression. For LZMA, big word size usually gives a little bit better compression ratio and slower compression process. Big word size parameter can significantly increase compression ratio in case when files contain long identical sequences of bytes. For PPMd word size has a big meaning. It strongly affects both compression ratio and compression/decompression speed.

There are some comparisons here