Post

archive formats

#1
Hey there - todays dev log is partly about archive formats.

First: Wise choice and its good to get this working at the beginning.
When Firefox introduced plain zip (well not so plain but that's another story) files to store the hundrets of files it got so much faster it was 'tha bomb'.

So - using plain zip will decrease loading time big time buuut it's not really cool and very old, no?
Linux Distributions switched to LZMA a while back with great success.
But big clunky files which should be downloadable and an archiver for fast random access is not neccessarily the same.

Until... you take 7zip. I guess everyone knows it but did you know that it can be tailored much more to your needs than you might think at first?
There are many command line options available which one cannot see in the GUI. Also more formats than just LZMA(2) are supportet.
I personally made some tests with 7zip's LZMA and found it to be very flexible. You can achieve a much better compression than zip but also keep the fast file access.
The only thing I couldn't directly manage was to not use more than X MB of RAM. Or better: do use as much RAM as possible to make loading faster if one needs to reload some kind of assets later and keep the file open - or store it in memory altogether. (Sure you can use filestream objects or the like for this but normally you don't want all of the file in RAM at any given time).

So the best thing I found to actually let the OS handle the caching of this file - and if your system sucks you will get loading screens more often. That's about it. :D

If you do only need to load it upfront you can just use high settings of LZMA which will also show you the amount of RAM you need to decompress. The time usually is really fast since its asynchronus (shorter decompressing time, longer compressing).

Online Now

Users browsing this forum: No registered users and 18 guests

cron