红联Linux门户
Linux帮助

Linux下解压工具对比

发布时间:2014-12-21 15:02:41来源:bentutu.com作者:linux人

Elementary OS团队的成员Shnatsel发布了关于自由Linux压缩工具的测试对比。

如果你想亲自尝试了这一点。


for testnum in $(seq 1 256); do
testnum=$(expr $testnum '*' 10)
for archiver in bzip2 lzma xz gzip lzip lzop lrzip; do
dd if=/dev/zero of=$testnum.zero bs="$testnum"'k' count=1
c=$(date +%s%N)
$archiver $testnum.zero
d=$(date +%s%N)
total=$(echo $d-$c | bc)
echo $total >> $archiver
rm $testnum.zero *.bz2 *.lzma *.gz *.xz *.lzo *.lz *.lrz
done
done
gnuplot <(echo "set terminal svg;set ylabel 'Time (nanoseconds)' textcolor lt 1; set xlabel 'Size (tens of kilobytes)' textcolor lt 2;plot 'lzma' with lines, 'xz' with lines, 'gzip' with lines, 'lzip' with lines, 'lzop' with lines, 'lrzip' with lines, 'bzip2' with lines") > test.svg
rm gzip lrzip lzip lzma lzop xz bzip2

for testnum in $(seq 0 256); do
testnum=$(expr $testnum '*' 10)
for archiver in bzip2 lzma xz gzip lzip lzop lrzip; do
dd if=/dev/zero of=$testnum.zero bs="$testnum"'k' count=1
$archiver $testnum.zero
rm $testnum.zero
c=$(date +%s%N)
$archiver -d $testnum.zero.*
d=$(date +%s%N)
total=$(echo $d-$c | bc)
echo $total >> $archiver
rm $testnum.zero *.bz2 *.lzma *.gz *.xz *.lzo *.lz *.lrz
done
done
gnuplot <(echo "set terminal svg;set ylabel 'Time (nanoseconds)' textcolor lt 1; set xlabel 'Size (tens of kilobytes)' textcolor lt 2;plot 'lzma' with lines, 'xz' with lines, 'gzip' with lines, 'lzip' with lines, 'lzop' with lines, 'lrzip' with lines, 'bzip2' with lines") > test.svg
rm gzip lrzip lzip lzma lzop xz bzip2


此外,如果您要使用上面的脚本,确保安装了所有所需的软件包:

sudo apt-get install gnuplot bzip2 lzma xz-utils gzip lzip lzop lrzip