Add TODOs for performance aspects

Signed-off-by: Olivier <olivier@librepush.net>
This commit is contained in:
Olivier 'reivilibre' 2024-09-29 00:10:20 +01:00
parent b410114523
commit 9d06016d06
1 changed files with 3 additions and 0 deletions

View File

@ -129,6 +129,8 @@ pub fn scan(root: &Path, ignores: &Vec<String>) -> eyre::Result<PatriciaMap<Scan
.build()
.context("failed to create overrides with ignore entries")?,
);
// TODO(performance): We could use `WalkParallel` if we restructure this code.
let walker = walker.build();
for entry in walker {
@ -195,6 +197,7 @@ fn scan_one_no_recurse(path: &Path, metadata: Metadata) -> eyre::Result<Option<S
size: metadata.size(),
}))
} else if filetype.is_dir() {
// TODO(perforance): this call is very likely wasteful
let dir_read = path.read_dir();
if let Err(e) = &dir_read {