-
Notifications
You must be signed in to change notification settings - Fork 178
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
Performance issues on Windows #73
Comments
Yeah, that is more than I expected. There is an overhead in I'll do some tests and try to optimize it. I'm quite busy currently, but I plan to work on this and #70, the other Windows issue the next days, hopefully tomorrow. |
I found at least one of the reasons going through the source with the call stack as hint, the evaluation of the permissions "executable" part is quite expensive and most of the time permissions of a directory_entry are not used. I think I'll defer the X-Part of the flags until permissions are actually used, and additionally try to optimize their evaluation. I'm on a trip right now (browsing code on the phone), but I think a test of that should be on a branch sometime tomorrow. Not sure about the impact yet. |
Sorry, there is some delay with the availability of a branch on this. My test was with I hope to give it another shot after work today, but I wanted to report back why there is no branch yet. |
ok, thanks for information! I'm ready for test |
My work is on branch: Okay, let me start by saying, I was not able to reproduce the huge gap from your measurements. My tests where on my Dev-Laptop, with an SSD (I have no Windows system with HDD available), and I'm using VisualStudio 2019, 16.7.4 and my baseline measurements are: Recursive iteration over
Not that impressive, still useful, with the difference of internal implementation in mind. I want to point out, that the additional
So my optimizations halved the overhead of the different internal representations, I'm happy with that. I then also created a single test directory with 20k files, to have a comparison without the impact of many
So in the best case, no additional status call, just flat iteration, the optimizations make it faster than I hope this helps your performance issues as well, even if I couldn't replicates your numbers. |
ghc::filesystem is slower than std::filesystem on Windows when working with directories that contain many files.
I tested it in directory which contains about 16600 files.
Enumerating files via ghc::filesystem takes about 50-60 seconds on my PC (NTFS, HDD).
Enumerating files via std::filesystem used from example code takes 2.5-5 seconds (same directory).
I think the problem corresponds to non-optimized iterator operators and 'status' operations.
Please look on call stack on image. Simple iterator increment operation requires call for 'status', which processed all data gathering, strings assigning, etc. So, for single pass for one file, 'status' operation called so many times with gathering a lot of not necessary information.
Maybe caching of file names, extensions, root paths, etc. instead calculation on each call, will make library faster.
The text was updated successfully, but these errors were encountered: