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

Further optimization of directory iterators with POSIX backend #111

Closed
gulrak opened this issue Mar 20, 2021 · 2 comments
Closed

Further optimization of directory iterators with POSIX backend #111

gulrak opened this issue Mar 20, 2021 · 2 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release POSIX POSIX type backend is affected
Milestone

Comments

@gulrak
Copy link
Owner

gulrak commented Mar 20, 2021

Is your feature request related to a problem? Please describe.
Further optimization of directory iteration on POSIX backend.

Describe the solution you'd like
Up until v1.5.2 the iteration issues stat calls even when their result is not needed, e.g. when the iteration only needs access to the filename and file type. This could be removed for a better performance in search scenarios. It should lead to a performance behavior comparable to existing POSIX backend std::filesystem implementations. (But it will lead to worse performance on cases where multiple additional attributes like file size or last write time are needed, where ghc::filesystem was faster.)

Additional context
The standard notes that an implementation should not call refresh (directly or implicit) on directory_entry, but work with the data given for free while iterating.

@gulrak gulrak self-assigned this Mar 20, 2021
@gulrak gulrak added the POSIX POSIX type backend is affected label Mar 20, 2021
@gulrak gulrak added this to the v1.5.4 milestone Mar 20, 2021
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Mar 21, 2021
@gulrak
Copy link
Owner Author

gulrak commented Mar 21, 2021

With 1037c02 the work on refining directory iteration on POSIX should be done. Tests iterating on large trees on an SSD show now timing results between those from std::filesystem::recursive_directory_iterator on GCC10/libstdc++ and Clang/libc++ and the implemented behavior is more conforming to the standard as it avoids system calls that are not absolutely necessary.

@gulrak
Copy link
Owner Author

gulrak commented Mar 21, 2021

This is now part of release v1.5.4

@gulrak gulrak closed this as completed Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release POSIX POSIX type backend is affected
Projects
None yet
Development

No branches or pull requests

1 participant