Skip to content
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

Implement scandir() #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chinpo-dev
Copy link

os.scandir() eliminates the need to use two system calls to get size of files. As apparently intended by the original author.
I used this software for years, and did a few edits of my own, finally got around to send it to repository. Thanks for making this.

As apparently intended years ago by the original author
Instead prints "failed to access <path"
@alanbernstein
Copy link
Owner

Thanks! It's nice to see someone else using this.

This is definitely worth it for the speedup, but when I did a quick comparison, I saw a problem with the text rendering off-center for leaf nodes. I'm not sure how this change would affect that. I imagine you haven't encountered this? I'll look into it when I get a chance.

@alanbernstein
Copy link
Owner

alanbernstein commented Jun 1, 2024

Sorry for the, uh, delay on this. I just quickly tried out scandir again and it's marginally slower than listdir on my machine.

69.754208 sec to scan 283.51GB / 1367919 files # os.listdir
72.081968 sec to scan 283.51GB / 1367939 files # os.scandir

Is the benefit for you just reducing extra system calls? Or do you see a speed improvement with scandir?

@alanbernstein alanbernstein force-pushed the master branch 2 times, most recently from 8563703 to 3a179ac Compare June 3, 2024 17:09
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