歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下解壓工具對比(圖表)

Linux下解壓工具對比(圖表)

日期:2017/2/28 16:11:26   编辑: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

Copyright © Linux教程網 All Rights Reserved