Skip to content

Less fs::metadata call in fn walk(#481

Closed
ldm0 wants to merge 1 commit into
bootandy:masterfrom
ldm0:reduce_metadata
Closed

Less fs::metadata call in fn walk(#481
ldm0 wants to merge 1 commit into
bootandy:masterfrom
ldm0:reduce_metadata

Conversation

@ldm0
Copy link
Copy Markdown

@ldm0 ldm0 commented Mar 30, 2025

PathBuf::is_dir/PathBuf::is_file calls fs::metadata individually and can be squashed.

@bootandy
Copy link
Copy Markdown
Owner

I can see you've removed a call to fs::metadata here which is good.

But the extra code makes it slightly harder to read as well.

Testing with hyperfine, I can't see any performance improvement with this version so I suspect the call to fs::metadata is cached.

I'm not convinced this is worth adding as it doesn't seem to have a performance improvement.

Good idea though.

@bootandy bootandy closed this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants