* Print out statistics comparing our performance to bzip2.
This commit is contained in:
parent
13f77276d1
commit
71926ee188
1 changed files with 20 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
#! /bin/sh -e
|
#! /bin/sh -e
|
||||||
|
|
||||||
DIFF=/home/eelco/Dev/nix/zdelta-2.1/zdc
|
#DIFF=/home/eelco/Dev/nix/zdelta-2.1/zdc
|
||||||
|
DIFF=/home/eelco/Dev/nix/bsdiff-4.2/bsdiff
|
||||||
|
|
||||||
srcA=$1
|
srcA=$1
|
||||||
srcB=$2
|
srcB=$2
|
||||||
|
@ -12,13 +13,28 @@ fi
|
||||||
|
|
||||||
(cd $srcB && find . -type f) | while read fn; do
|
(cd $srcB && find . -type f) | while read fn; do
|
||||||
|
|
||||||
echo "$fn" >&2
|
|
||||||
|
|
||||||
if test -f "$srcA/$fn"; then
|
if test -f "$srcA/$fn"; then
|
||||||
|
|
||||||
echo "FILE DELTA FOR $fn"
|
echo "FILE DELTA FOR $fn"
|
||||||
|
|
||||||
$DIFF "$srcA/$fn" "$srcB/$fn"
|
TMPFILE=/tmp/__bsdiff
|
||||||
|
$DIFF "$srcA/$fn" "$srcB/$fn" $TMPFILE
|
||||||
|
cat $TMPFILE
|
||||||
|
|
||||||
|
diffSize=$(stat -c '%s' $TMPFILE)
|
||||||
|
|
||||||
|
# For comparison.
|
||||||
|
bzipSize=$(bzip2 < "$srcB/$fn" | wc -m)
|
||||||
|
|
||||||
|
gain=$(echo "scale=2; ($diffSize - $bzipSize) / $bzipSize * 100" | bc)
|
||||||
|
|
||||||
|
ouch=$(if test "${gain:0:1}" != "-"; then echo "!"; fi)
|
||||||
|
|
||||||
|
printf "%7.2f %1s %10d %10d %s\n" \
|
||||||
|
"$gain" "$ouch" "$diffSize" "$bzipSize" "$fn" >&2
|
||||||
|
# echo "$fn -> $diffSize $bzipSize ==> $gain $ouch" >&2
|
||||||
|
|
||||||
|
rm $TMPFILE
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue