4 # Benchmarks run on a Ubuntu 14.04 VM with 2 cores and 4 GiB of RAM.
5 # The VM is running on a Macbook Pro with a 3.1 GHz Intel Core i7 processor and
6 # 16 GB of RAM and an SSD.
8 # $BENCHMARK_DIR is generated with the following commands, from the Ubuntu image
9 # ubuntu-16.10-desktop-amd64.iso.
11 # > sudo mount -o loop ubuntu-16.10-desktop-amd64.iso mnt
12 # > cp mnt/casper/filesystem.squashfs .
13 # > sudo unsquashfs filesystem.squashfs
15 # $HOME is on a ext4 filesystem
16 BENCHMARK_DIR="$HOME/squashfs-root/"
17 BENCHMARK_FS="$HOME/filesystem.squashfs"
19 # Normalize the environment
20 sudo rm -f $BENCHMARK_FS 2> /dev/null > /dev/null || true
21 sudo umount /mnt/squashfs 2> /dev/null > /dev/null || true
25 echo "sudo mksquashfs $BENCHMARK_DIR $BENCHMARK_FS $@"
26 time sudo mksquashfs $BENCHMARK_DIR $BENCHMARK_FS $@ 2> /dev/null > /dev/null
28 echo "Approximate compression ratio"
30 $(sudo du -sx --block-size=1 $BENCHMARK_DIR | cut -f1) \
31 $(sudo du -sx --block-size=1 $BENCHMARK_FS | cut -f1);
33 # Mount the filesystem
34 sudo mount -t squashfs $BENCHMARK_FS /mnt/squashfs
37 time sudo tar -c /mnt/squashfs 2> /dev/null | wc -c > /dev/null
39 sudo umount /mnt/squashfs