-
Notifications
You must be signed in to change notification settings - Fork 205
Performance issues on Windows #73
Copy link
Copy link
Closed
Labels
WindowsWindows platform is affectedWindows platform is affectedavailable on masterFix is done on master branch, issue closed on next releaseFix is done on master branch, issue closed on next releaseenhancementNew feature or requestNew feature or request
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
WindowsWindows platform is affectedWindows platform is affectedavailable on masterFix is done on master branch, issue closed on next releaseFix is done on master branch, issue closed on next releaseenhancementNew feature or requestNew feature or request
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.