You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've documented some performance issues with squashfuse here: https://github.com/haampie/squashfs-mount/. I'm observing about a 1.5x increase in compile time of LLVM when mounting compilers from a squashfs file using squashfuse compared to just using (lib)mount.
The high-level version uses a simpler FUSE API, which has wider availability. A number of platforms (Minix, NetBSD) only support the high-level API. Unfortunately, the high-level API doesn't map one-to-one(-ish) with kernel VFS operations, but instead talks to a library that manages things like inode allocation, that make it inherently slower. Something that hits many different inodes, like du, should be particularly bad.
If squashfuse_ll works better for you, then I recommend sticking with it! But I'd like to keep squashfuse available on other platforms, and there's no harm in leaving the high-level version around.
Let me rename this ticket to something about optimizing high-level squashfuse, since that seems to be where this has landed. Please go ahead and explain how you did your testing, and share what results you got. Then we can use this as an opportunity for anybody who wants to spend time optimizing high-level squashfuse.
$ time du -sh /x
43G /x
real 0m12.548s
user 0m0.040s
sys 0m0.592s
$ time du -sh /x
43G /x
real 0m12.450s
user 0m0.024s
sys 0m0.569s
$ time du -sh /x
43G /x
real 0m12.397s
user 0m0.059s
sys 0m0.526s
there's no caching effects.
squashfuse_ll is 13x better the first and 45x better the second and later runs:
$ squashfuse_ll file.squashfs /x
$ time du -sh /x
42G /x
real 0m0.902s
user 0m0.040s
sys 0m0.405s
$ time du -sh /x
42G /x
real 0m0.275s
user 0m0.018s
sys 0m0.167s
$ time du -sh /x
42G /x
real 0m0.269s
user 0m0.005s
sys 0m0.176s
mount is best:
$ time du -sh /x
42G /x
real 0m0.527s
user 0m0.020s
sys 0m0.497s
$ time du -sh /x
42G /x
real 0m0.108s
user 0m0.032s
sys 0m0.075s
$ time du -sh /x
42G /x
real 0m0.109s
user 0m0.028s
sys 0m0.080s
Perf shows squashfuse spends all its time decompressing:
Activity
vasi commentedon Jun 21, 2022
You would definitely expect overhead from FUSE over an in-kernel driver, yes.
haampie commentedon Jun 22, 2022
Okay, then I'll stick to the kernel version for now. Thanks!
haampie commentedon Sep 16, 2022
FWIW: when using
squashfuse_llinstead ofsquashfuseI get a 10x speedup fordu -sh mountpoint/.Perf tells me
squashfusespends the vast majority of time decompressing whereassquashfuse_llspends like 5% of the time there.Is there any reason to keep the high-level version if the low-level version performs so much better?
vasi commentedon Sep 17, 2022
The high-level version uses a simpler FUSE API, which has wider availability. A number of platforms (Minix, NetBSD) only support the high-level API. Unfortunately, the high-level API doesn't map one-to-one(-ish) with kernel VFS operations, but instead talks to a library that manages things like inode allocation, that make it inherently slower. Something that hits many different inodes, like du, should be particularly bad.
If squashfuse_ll works better for you, then I recommend sticking with it! But I'd like to keep squashfuse available on other platforms, and there's no harm in leaving the high-level version around.
Let me rename this ticket to something about optimizing high-level squashfuse, since that seems to be where this has landed. Please go ahead and explain how you did your testing, and share what results you got. Then we can use this as an opportunity for anybody who wants to spend time optimizing high-level squashfuse.
[-]Bad performance compared to `mount`[/-][+]High-level squashfuse optimization opportunities[/+]haampie commentedon Sep 17, 2022
Using
squashfusethe timing is consistently:there's no caching effects.
squashfuse_llis 13x better the first and 45x better the second and later runs:mountis best:Perf shows squashfuse spends all its time decompressing: