File compression
A while ago, I wrote a small tip on compressing ANSYS files on ansys.net. I still like using 7-zip, and it remains my compression utility of choice on Microsoft Windows when archiving data. (On Linux, I tend to stick with tar and gzip for archiving files — old habits are hard to break…)
One thing I have started to change, though, is the compression program I use for transferring files between machines. I sometimes may solve larger models on a Linux cluster, then transfer these files back to my Linux or Windows PC for postprocessing. The result files can be large, and I may not care to get the best compression ratio; I may just want to compress the result file small enough to make transferring between machines easier.
Here are some results for a given ANSYS .rst result file for some popular compression programs on Linux, where the compressed file size compared with original, along with compression time as compared with lzop, are given:
- lzop: 58.75%, baseline
- gzip: 53.11%, 4.5x slower than lzop
- bzip2: 52.03%, 13.x slower than lzop
- lzma: 47.43%, 45x slower than lzop
For the above results, only the ‘default’ compression setting was used. (Typically, using a ‘higher’ compression scheme results in much more CPU time for very modest gains in compression ratio.) Also, programs that use similar algorithms to the above were not tested (e.g., zip, p7zip, rzip, etc.), and results for ppmd are not shown since that algorithm works best on text files rather than binary files like the ANSYS result file.
As one can see from the above, the lzma method (default in 7-zip) provides the best compression ratio, but it is 45x slower than lzop. If one is interested in compressing files just to make file transfer/temporary storage quicker, use of lzop in these cases may be preferred, as the file size is still compressed well (~60% of original file size), and it is very fast, even compared with gzip.
Note that 7-zip currently doesn’t support the LZO method, so use of cygwin or the binary files from the lzop homepage are needed if you’re using Windows.
Comments are closed.