Skip to content

anonymous /compression_benchmark.sh
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.