-
Notifications
You must be signed in to change notification settings - Fork 63
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
Dir: replace FilePath with OsPath #2641
Conversation
Results look pretty impressive! Thanks for working on this. I will take a better look later. We will have to manage the migration from FilePath to OsPath in the released APIs. Maybe deprecate the old ones in 0.11 and gradually move to OsPath instead of managing two versions? |
The To assess the impact of this change we can compare the serial version of |
For comparing, I tried this serial impl of ListDir on old and new code:
Old:
New:
This is pretty good improvement just by replacing FilePath with OsPath, but if we have to compete with find we need to read the attributes of the files along with the names in one go. Our goal should be to bring the serial impl time below find and then concurrent would automatically become better. |
On Linux we get the |
I will hack up a quick readdir implementation that provides the Dir/File status in the same call and check. |
Added a commit on top of this in #2642 . Now I am getting:
Improved from 643ms to 463ms. But still there is scope for improvement. Need to try removing the overhead of bracketIO and a few other small optimizations. @domenkozar I have added you to the repo, so that we can push commits on the same PR. |
We were spending a lot of time in the show instance in ListDir. I buffered and printed the OsPath byte-arrays.
Now we are same as the rust fd (concurrent version comparison).
Our CPU time is lower but actual time is same as |
ListDir changes: composewell/streamly-examples#66 |
I made some more changes, we are now significantly faster than rust fd:
You can try out the changes from #2642 and the example program from composewell/streamly-examples#66 . I have to do some cleanup and complete the change before committing. We can have it in streamly-core 0.2.2 coming soon. |
Nice! |
Fixes #2168 for Dir, File is yet to be done.
I've hacked this together mostly to get some benchmarks if it addresses #2200 and it does!
Note that you have to pass
-L
tofind
so that it resolves symlinks to get the same behavior.On a directory with about 855k items: