Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
bpo-33671 / shutil.copyfile: use memoryview() with dynamic size on Windows#7681
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
16 commits Select commitHold shift + click to select a range
820fc21 bpo-33671: release sub-memoryview resources immediately
giampaolo7c55be5 rename OSX to macOS
giampaolodb6a9ad add unit tests for copyfileobj
giampaolo090df6a Remove _copybinfileobj() implementation
giampaolodf2354f update doc
giampaolo4e2b9f8 update doc
giampaolodae995a update doc
giampaolo9f6cf1f update doc
giampaolo06d3e7a update doc
giampaolo8a3f88e Reintroduce memoryview() variant of copyfileobj()
giampaolof47c011 speed up test case by mocking file size instead of creating an actua…
giampaoloc3166e1 update doc
giampaolo89cd883 update comments
giampaolobe40ae1 rename var
giampaolo93ebc1f Use dynamic memoryview() size based on file size
giampaolo9d93ce5 do not attempt to use sendfile() on OSX
giampaoloFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 5 additions & 1 deletionDoc/library/shutil.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
28 changes: 17 additions & 11 deletionsDoc/whatsnew/3.8.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
72 changes: 39 additions & 33 deletionsLib/shutil.py
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
88 changes: 81 additions & 7 deletionsLib/test/test_shutil.py
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
15 changes: 7 additions & 8 deletionsMisc/NEWS.d/next/Library/2018-05-28-23-25-17.bpo-33671.GIdKKi.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 |
|---|---|---|
| @@ -1,11 +1,10 @@ | ||
| :func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, | ||
| :func:`shutil.copytree` and :func:`shutil.move` use platform-specific | ||
| fast-copy syscalls on Linux, Solaris and macOS in order to copy the file | ||
| more efficiently. | ||
| On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB | ||
| instead of 16 KiB) and a :func:`memoryview`-based variant of | ||
| :func:`shutil.copyfileobj` is used. | ||
| The speedup for copying a 512MiB file is about +26% on Linux, +50% on macOS and | ||
| +40% on Windows. Also, much less CPU cycles are consumed. | ||
| (Contributed by Giampaolo Rodola' in :issue:`25427`.) |
4 changes: 2 additions & 2 deletionsModules/clinic/posixmodule.c.h
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
4 changes: 2 additions & 2 deletionsModules/posixmodule.c
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
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.