-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-33695 shutil.copytree() + os.scandir() cache #7874
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
Merged
giampaolo
merged 19 commits into
python:master
from
giampaolo:33695-shutil-scandir-cache
Nov 12, 2018
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f47106d
Have shutil.copytree(), copy() and copystat() use cached scandir() st…
giampaolo 6334960
Merge branch 'master' into 33695-shutil-scandir-cache
giampaolo 203dca7
Merge branch 'master' into 33695-shutil-scandir-cache
giampaolo b5cf416
close scandir() context
giampaolo a35a256
Merge branch 'master' into 33695-shutil-scandir-cache
giampaolo e588b4c
use global vars instead of hasattr()
giampaolo 2097163
remove unused function
giampaolo 627405f
remove ctx manager around os.scandir() to make review easier
giampaolo 1cb0bff
remove ctx manager around os.scandir() to make review easier
giampaolo 4da7f76
update doc
giampaolo a847944
add ref to ticket number and credits
giampaolo 58a27af
Merge branch 'master' into 33695-shutil-scandir-cache
giampaolo 5715235
use os.path.islink() instead of is_symlink() in onerror()
giampaolo dedf67a
use os.listdir() to collect ignored file names
giampaolo 559ab8a
avoid passing DirEntry in case of custom 'copy_function'
giampaolo 4103778
use a support _copytree function to avoid 1 level indentation
giampaolo 91fa2e2
small refactoring
giampaolo 5712a0a
indentation
giampaolo f0806db
be more explicit and do not globalize function availability via hasat…
giampaolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Misc/NEWS.d/next/Library/2018-06-23-12-47-37.bpo-33695.seRTxh.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:func:`shutil.copytree` uses :func:`os.scandir` function and all copy | ||
functions depending from it use cached :func:`os.stat` values. The speedup | ||
for copying a directory with 8000 files is around +9% on Linux, +20% on | ||
Windows and + 30% on a Windows SMB share. Also the number of :func:`os.stat` | ||
syscalls is reduced by 38% making :func:`shutil.copytree` especially faster | ||
on network filesystems. | ||
(Contributed by Giampaolo Rodola' in :issue:`33695`.) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.