conserve icon indicating copy to clipboard operation
conserve copied to clipboard

Try using `fs_at`

Open sourcefrog opened this issue 3 years ago • 3 comments

Context: https://github.com/sourcefrog/conserve/issues/172#issuecomment-1206291687

Using fs_at would potentially reduce time spent both constructing paths, and inside the kernel on parsing and traversing paths.

This probably needs to be threaded through the Transport layer, as not all transports will support the same concept.

This could be implemented independently on both source/restore trees, and archives.

I don't think this is a dominant performance driver at the moment but it might be interesting.

To do this usefully I think we'd need ReadDir equivalent (https://github.com/rbtcollins/fs_at/issues/11).

cc @rbtcollins fyi

sourcefrog avatar Aug 05 '22 14:08 sourcefrog

To use fs_at, it would have to also support stating files and reading links, which it currently does not, but which could be possible with readlinkat and fstatat.

sourcefrog avatar Aug 07 '22 04:08 sourcefrog

fstat : https://doc.rust-lang.org/std/fs/struct.File.html#method.metadata [if you want to minimise calls, open() + fstat is cheaper than fstatat () + open() + fstat() to check it is still what you expected.]

readlinkat is probably needed, haven't gotten that far yet :P .

rbtcollins avatar Aug 07 '22 10:08 rbtcollins

https://github.com/sourcefrog/cp_r/compare/fs_at?expand=1 is an experiment towards using fs_at in a similar but smaller crate.

sourcefrog avatar Aug 07 '22 18:08 sourcefrog