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

Recursive directory traversal performance #2200

Open
harendra-kumar opened this issue Jan 2, 2023 · 0 comments
Open

Recursive directory traversal performance #2200

harendra-kumar opened this issue Jan 2, 2023 · 0 comments
Assignees
Labels
type:performance impacts performance
Milestone

Comments

@harendra-kumar
Copy link
Member

The recursive directory listing APIs are inefficient as they list each directory and then use the produced paths to try to list the children. Instead we can use the inodes directly, also we can list the attributes at the same time to filter out non-dir children.

Currently the traversal using the ListDir example in streamly-examples is significantly slower than ls on Linux:

$ time ListDir > /dev/null

real    0m0.874s
user    0m0.657s
sys     0m0.228s

$ time ls -rRa . > /dev/null

real    0m0.201s
user    0m0.103s
sys     0m0.096s

$ time find . > /dev/null

real    0m0.229s
user    0m0.095s
sys     0m0.132s

Also need to see if the stream based recursive traversal is less efficient. Also, the use of String instead of OsPath might make a difference as we are heavily dealing with paths here.

@harendra-kumar harendra-kumar added the type:performance impacts performance label Jan 2, 2023
@harendra-kumar harendra-kumar added this to the 0.10.0 milestone Jan 2, 2023
@harendra-kumar harendra-kumar modified the milestones: 0.10.0, 0.11.0 Jan 12, 2024
@harendra-kumar harendra-kumar self-assigned this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:performance impacts performance
Projects
None yet
Development

No branches or pull requests

1 participant