Skip to content

Implement scandir() - #1

Open
chinpo-dev wants to merge 2 commits into
alanbernstein:masterfrom
chinpo-dev:chinpo-dev-scandir
Open

Implement scandir()#1
chinpo-dev wants to merge 2 commits into
alanbernstein:masterfrom
chinpo-dev:chinpo-dev-scandir

Conversation

@chinpo-dev

Copy link
Copy Markdown

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
Copy Markdown
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

alanbernstein commented Jun 1, 2024

Copy link
Copy Markdown
Owner

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