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

FileUtils : Use Dir.children instead of Dir.entries #1754

Closed
wants to merge 1 commit into from

Conversation

@esparta
Copy link
Contributor

esparta commented Nov 15, 2017

Feature #14109

Dir.children is available since Feature #11302.
FileUtils uses Dir.each on an internal method encapsulated on a private class Entry_#entry, having no '.' neither '..' entries would make now superfluous a chained reject filtering.

This change can improve the performance of these FileUtils methods when the provided path covers thousands of files or directories:

  • chmod_R
  • chown_R
  • remove_entry
  • remove_entry_secure
  • rm_r
  • remove_dir
  • copy_entry

Related: Feature #13896

Feature #14109

Dir.children is available since Feature #11302. FileUtils uses
Dir.each on an internal method encapsulated on a private class
`Entry_#entry`, having no '.' neither '..' entries would make
now superfluous a chained reject filtering.

This change can improve the performance of these FileUtils
methods when the provided path covers thousands of files or
directories:

- chmod_R
- chown_R
- remove_entry
- remove_entry_secure
- rm_r
- remove_dir
- copy_entry

Related: Feature #13896 https://bugs.ruby-lang.org/issues/13896
@matzbot matzbot force-pushed the ruby:trunk branch from 2677ddd to ce7ad3a Jan 18, 2018
@matzbot matzbot closed this in 37c08fa Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.