Closed tych0 closed 1 year ago
Comparison with squashfuse:
Installation (Arch Linux):
❯ sudo pacman -S squashfuse
❯ sudo pacman -S squashfs-tools
❯ mksquashfs real_rootfs/barehost/rootfs barehost.sqhs
Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on barehost.sqhs, block size 131072.
[=========================================================================|] 20365/20365 100%
❯ squashfuse -h
squashfuse 0.1.104 (c) 2012 Dave Vasilevsky
❯ ../puzzlefs/target/debug/puzzlefs build real_rootfs/barehost/rootfs /tmp/oci-barehost test
This is the fairest comparison since puzzlefs doesn't support parallel operation
❯ squashfuse -f -s barehost.sqhs /tmp/squash
tree /tmp/squash 0.06s user 0.15s system 7% cpu 2.856 total
❯ ../puzzlefs/target/debug/puzzlefs mount -f /tmp/oci-barehost test /tmp/puzzle
tree /tmp/puzzle 0.13s user 0.40s system 0% cpu 1:24.17 total
❯ target/release/puzzlefs mount -f /tmp/oci-barehost test /tmp/puzzle
tree /tmp/puzzle 0.08s user 0.36s system 0% cpu 52.685 total
tree /tmp/squash 0.06s user 0.15s system 7% cpu 2.870 total
# debug
tree /tmp/puzzle 0.06s user 0.09s system 5% cpu 3.105 total
# release
tree /tmp/puzzle 0.06s user 0.08s system 7% cpu 1.857 total
Traversing a puzzlefs mounted filesystem the first time after it is mounted is significantly slower than traversing a squashfuse filesystem, but subsequent runs are close to the performance of squashfuse.
Also note that the output of tree
is not the same for squashfuse and puzzlefs, that's because puzzlefs has some limitations (e.g. it cannot read symbolic links).
❯ squashfuse -f barehost.sqhs /tmp/squash
tree /tmp/squash 0.08s user 0.15s system 8% cpu 2.902 total
tree /tmp/squash 0.06s user 0.16s system 7% cpu 2.868 total
Multi-threaded operation of squashfuse doesn't help performance in the case of traversing the filesystem with tree
.
puzzlefs:
$ target/release/puzzlefs mount -f /tmp/oci-barehost test /tmp/puzzle
squashfuse:
squashfuse -f barehost.sqhs /tmp/squash
$ time tree /tmp/squash
2325 directories, 19265 files
tree /tmp/squash 0.08s user 0.17s system 8% cpu 2.893 total
$ time tree /tmp/puzzle
2325 directories, 19265 files
tree /tmp/puzzle 0.10s user 0.37s system 1% cpu 44.427 total
2325 directories, 19265 files
tree /tmp/puzzle 0.07s user 0.17s system 13% cpu 1.764 total
right now we do an on-disk binary search for finding each inode. the fs cache might help us here, but it may be worth either 1. maybe mmaping the inode metadata region? or 2. reading some/all of the inodes into memory in order to speed this up.
This probably depends on the number of inodes in a particular layer.