Documentation
The original documention https://docs.python.org/3/library/shutil.html#shutil-platform-dependent-efficient-copy-operations about Platform-dependent efficient for Windows only mentioned that shutil.copyfile(), but which is a bad read and write loop still.
Actually the shutil.copy2() used the Windows API COPYFILE2, which is faster, and native call which means don't copy to memory on userspace, and support copy-on-write.
So this should be mentioned in documention to let people know rather than only knowing until read all the opened issues on github and source code of shutil.
Related info:
how shutil was implemented: #7160.
why only shutil.copy2() use Windows API COPYFILE2 while shutil.copyfile() not: #137074.
data that shows shutil.copy2() or Windows API COPYFILE2 can accelerate transfer speed: https://github.com/antirotor/speedcopy.
PR of new version copy2 implemented: #105055.
Linked PRs
Documentation
The original documention https://docs.python.org/3/library/shutil.html#shutil-platform-dependent-efficient-copy-operations about Platform-dependent efficient for Windows only mentioned that
shutil.copyfile(), but which is a bad read and write loop still.Actually the
shutil.copy2()used the Windows API COPYFILE2, which is faster, and native call which means don't copy to memory on userspace, and support copy-on-write.So this should be mentioned in documention to let people know rather than only knowing until read all the opened issues on github and source code of
shutil.Related info:
how
shutilwas implemented: #7160.why only
shutil.copy2()use Windows APICOPYFILE2whileshutil.copyfile()not: #137074.data that shows
shutil.copy2()or Windows APICOPYFILE2can accelerate transfer speed: https://github.com/antirotor/speedcopy.PR of new version copy2 implemented: #105055.
Linked PRs