Skip to main content

Posts

Showing posts from 2013

Using Posix 7zip on the Cosole for Fast Compression

7zip has a fast compression algorithm using LZMA2 with as many threads (logic processors, cores, etc) as you like.  In this article we are focusing on the Posix version of 7zip for linux/unix. Here is an example command: 7za a -m0=lzma2 -mmt=2 -mx=1 MyZip.7z mydatabase.dpdmp -m0=lzma2 tells 7zip to use the LZMA2 compression algorithm. -mmt specifies the number of logic processors to use (multi threads) -mx=1 tells 7zip to use the fastest compression This is faster and better compression than zip and gzip and while comparable to bzip2 in size it is way faster than bzip2. Throw that together with a command that detects the number of logical processors and you get a function that discovers how many CPU's to use. LCPU=`cat /proc/cpuinfo | grep processor | wc -l` 7za a -m0=lzma2 -mmt=${LCPU} -mx=1 MyZip.7z mydatabase.dpdmp