diff options
Diffstat (limited to 'archivers/libarchive/files/contrib/psota-benchmark/tcp.sh')
-rw-r--r-- | archivers/libarchive/files/contrib/psota-benchmark/tcp.sh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/archivers/libarchive/files/contrib/psota-benchmark/tcp.sh b/archivers/libarchive/files/contrib/psota-benchmark/tcp.sh index 6c0e4b5e92e..3f630732be7 100644 --- a/archivers/libarchive/files/contrib/psota-benchmark/tcp.sh +++ b/archivers/libarchive/files/contrib/psota-benchmark/tcp.sh @@ -1,9 +1,9 @@ #!/bin/sh -# tar comparision program +# tar comparison program # 2007-10-25 Jan Psota n=3 # number of repetitions -TAR=(bsdtar gnutar star) # TApeArchivers to compare +TAR="bsdtar gnutar star" # Tape archivers to compare OPT=("" "--seek" "-no-fsync") pax="--format=pax" # comment out for defaults OPN=(create list extract compare) # operations @@ -16,9 +16,9 @@ test $# -ge 2 || { [where_to_extract_it] TCP, version $version -TCP stands for Tar Comparision Program here. +TCP stands for Tar Comparison Program here. It currently compares: BSD tar (bsdtar), GNU tar (gnutar) and star in archive -creation, listing, extraction and archive-to-extracted comparision. +creation, listing, extraction and archive-to-extracted comparison. Tcp prints out best time of n=$n repetitions. Tcp creates temporary archive named tcp.tar with $pax and some native @@ -60,15 +60,21 @@ test -e /etc/gentoo-release \ && gcc --version | head -1 && grep ^CFLAGS /etc/make.conf # tar versions +t= echo -for tar in [EMAIL PROTECTED]; do echo -ne "$tar:\t"; $tar --version | head -1; +for tar in $TAR; do + if which $tar &> /dev/null; then + t="$t $tar"; + echo -ne "$tar:\t"; $tar --version | head -1; + fi done +TAR="$t" + echo -e "\nbest time of $n repetitions,\n"\ " src=$src, "\ `du -sh $src | awk '{print $1}'`" in "`find $src | wc -l`" files, "\ -"avg "$((`du -sk $src | awk '{print $1}'`/`find $src -type f | wc --l`))"KB/file,\n"\ +"avg "$((`du -sk $src | awk '{print $1}'`/`find $src -type f | wc -l`))"KB/file,\n"\ " archive=$dst, extract to $dst_path" echo -e "program\toperation\treal\tuser\tsystem\t%CPU\t speed" @@ -77,7 +83,7 @@ let op_num=0 for op in "cf $dst $pax -C $src ." "tf $dst" "xf $dst -C $dst_path" \ "f $dst -C $dst_path --diff"; do let tar_num=0 - for tar in [EMAIL PROTECTED]; do + for tar in $TAR; do echo -en "$tar\t${OPN[op_num]}\t" for ((i=1; i<=$n; i++)); do echo $op | grep -q ^cf && rm -f $dst |