LUA scripts have a better compression rate than its bytecode
April 18th, 2009 Posted in Do You Know ? | No Comments »Atleast with ZLib ! I didn’t test with other compression algorithms. But the result will probably be the same for all others compressions.
So why ?
The reason is simple: most of algorithms can compress very efficiently text but when it comes to binary data, they just suck.
So check it by your self:
- Strip your scripts by removing comments, useless spaces and carriage returns
- Compress it
- Compile the same strip script
- Compress it
You’ll see that you can gain up to 75% the size of the compressed byte-code.
It could interest people trying to save memory in their resource script managers or loading time from DVD or any slow IO device.