public
Created

  • Download Gist
compression_benchmark.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#!/bin/sh
 
tmp=/dev/shm
in=$tmp/in
out=$tmp/out
mnt=/mnt/1
 
mkdir -p $in
mkdir -p $out
mkdir -p $mnt
 
zypper in clicfs cloop squashfs
 
if true ; then
for c in gzip lzo xz ; do
echo compression:$c write
o=$out/out.squashfs
rm -f $o
time mksquashfs $in $o -comp $c -no-progress > /dev/null
du $o
echo compression:$c read
mount -o loop,ro $o $mnt
time find $mnt -type f -print0 | xargs -0 cat > /dev/null
umount $mnt
done
fi
 
echo "benchmarking cloop"
i=$in.ext2
dd if=/dev/zero of=$i bs=1M count=600
mkfs.ext2 -F $i
mount -o loop $i $mnt
rsync -aSH $in/ $mnt/
umount $mnt
time create_compressed_fs $i $out/cloop
du $out/cloop
modprobe cloop
losetup -r /dev/cloop0 $out/cloop
mount -r /dev/cloop0 $mnt
time find $mnt -type f -print0 | xargs -0 cat > /dev/null
umount $mnt
 
 
echo "benchmarking clicfs"
time mkclicfs $i $out/clicfs
du $out/clicfs
clicfs $out/clicfs $mnt
mount -o loop $mnt/in.ext2 $mnt
time find $mnt -type f -print0 | xargs -0 cat > /dev/null
umount $mnt
umount $mnt

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.