8000 Less `fs::metadata` call in `fn walk(` by ldm0 · Pull Request #481 · bootandy/dust · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ldm0
Copy link
@ldm0 ldm0 commented Mar 30, 2025

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

@bootandy
Copy link
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.

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
0