Archive: strange size reduction


strange size reduction
I have notices that starting a dialog text string with a dot REDUCES the size of the installer with 3 bytes!

Am i stupid or is this really weird?
I understand if nobody finds this interesting, but i had to post it.


What do you mean by "dialog text string"?


The reason is that the compression algorithms can somehow compress certain strings better when preceeded by a dot. To test it, I've added a dot in front of a string in my installer and it's size reduced by 2. Then I've added another dot to some other strings and this time the size increased by 4.
The compression algorithm just compresses it differently as it may see more or less common patterns in the strings.

Look a this string: ABBAABBAABBAABBAABB
The compression algo could make this out of it (very much simplified):
4xABBA 1xABB
Now add another A to the front, now the algo could find this:
5xAABB, and this is shorter than without the extra A.

Try compiling without compression, installer size should always grow when adding dots ;)