Keywords: Benchmark common compression formats - Compressing speed.svg en This is a comparison of popular compression formats by how many nanoseconds it takes to compress each format The horizontal scale shows number or paragraphs containing random lorem ipsum text 2011-09-07 own AzaToth Following script was used to make the plots They where run on a mounted tmpfs dir <source lang bash > /bin/bash rm -f compress decompress factor for testnum in seq 0 500 10000 ; do lorem -p testnum > data for archiver in bzip2 lzma xz gzip lzip lzop lrzip; do case archiver in bzip2 suffix bz2;; lzma suffix lzma;; xz suffix xz;; gzip suffix gz;; lzip suffix lz;; lzop suffix lzo;; lrzip suffix lrz;; esac cp data current- testnum s1 stat -c s current- testnum c date + s N archiver current- testnum d date + s N total echo d- c bc echo testnum total >> archiver compress s2 stat -c s current- testnum suffix factor echo scale 10; s1/ s2 bc echo testnum factor >> archiver factor rm -f current- testnum c date + s N archiver -d current- testnum suffix d date + s N total echo d- c bc echo testnum total >> archiver decompress rm -f current rm -f bz2 lzma gz xz lzo lz lrz done done gnuplot < echo set terminal svg;set ylabel 'Time nanoseconds ' textcolor lt 1; set xlabel 'Size Number of paragraphs of random lorem ipsum text ' textcolor lt 2;plot 'lzma compress' title 'lzma' with lines 'xz compress' title 'xz' with lines 'gzip compress' title 'gzip' with lines 'lzip compress' title 'lzip' with lines 'lzop compress' title 'lzop' with lines 'lrzip compress' title 'lrzip' with lines 'bzip2 compress' title 'bzip2' with lines > compress svg gnuplot < echo set terminal svg;set ylabel 'Time nanoseconds ' textcolor lt 1; set xlabel 'Size Number of paragraphs of random lorem ipsum text ' textcolor lt 2;plot 'lzma decompress' title 'lzma' with lines 'xz decompress' title 'xz' with lines 'gzip decompress' title 'gzip' with lines 'lzip decompress' title 'lzip' with lines 'lzop decompress' title 'lzop' with lines 'lrzip decompress' title 'lrzip' with lines 'bzip2 decompress' title 'bzip2' with lines > decompress svg gnuplot < echo set terminal svg;set ylabel 'Compression factor' textcolor lt 1; set xlabel 'Size Number of paragraphs of random lorem ipsum text ' textcolor lt 2;plot 'lzma factor' title 'lzma' with lines 'xz factor' title 'xz' with lines 'gzip factor' title 'gzip' with lines 'lzip factor' title 'lzip' with lines 'lzop factor' title 'lzop' with lines 'lrzip factor' title 'lrzip' with lines 'bzip2 factor' title 'bzip2' with lines > factor svg </source> cc-zero Uploaded_with_UploadWizard Gnuplot_diagrams Images with BASH source code |