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
While profiling for issue #33 I noticed, that getattr of directories (which happens frequently, e.g. when the caller wants to know if a file exists or is a directory) takes a lot of time due to nlinks depending on the number of subdirectories:
The run time of countSubDirs vastly depends on the number of items in a directory, which makes getattr of the directory dependend on its size, which can lead to significant slowdowns:
The st_nlink for dirs is actualy not well defined. But the convention under unix is that it is the number of subdirectories including "." and "..".
[...]
But I think st_nlink == 1 is save in that regard and find will see that st_nlink doesn't follow the unix convention. Any other st_nlink will need "find -noleaf".
While we should try to set st_nlink to the number of subdirectories + 2, it should be ok to hard-code a fixed value in case we can't find an efficient solution to get the number of subdirectories.
The text was updated successfully, but these errors were encountered:
While profiling for issue #33 I noticed, that
getattr
of directories (which happens frequently, e.g. when the caller wants to know if a file exists or is a directory) takes a lot of time due to nlinks depending on the number of subdirectories:fuse-nio-adapter/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyDirectoryHandler.java
Lines 43 to 50 in a412b13
The run time of
countSubDirs
vastly depends on the number of items in a directory, which makesgetattr
of the directory dependend on its size, which can lead to significant slowdowns:Other FUSE file systems don't support link count either, such as sshfs, which simply hard-coded
st_nlink=1
.Citing Han-Wen Nienhuys:
While we should try to set
st_nlink
to the number of subdirectories + 2, it should be ok to hard-code a fixed value in case we can't find an efficient solution to get the number of subdirectories.The text was updated successfully, but these errors were encountered: