File:Benchmark common compression formats - Compressing speed.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 600 × 480 pixels, file size: 10 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: 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
Date
Source Own work
Author AzaToth

Following script was used to make the plots. They where run on a mounted tmpfs dir:

#!/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

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current00:55, 7 September 2011Thumbnail for version as of 00:55, 7 September 2011600 × 480 (10 KB)AzaToth (talk | contribs)

There are no pages that use this file.

Metadata