diff options
Diffstat (limited to 'Doc/whatsnew/3.8.rst')
-rw-r--r-- | Doc/whatsnew/3.8.rst | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 58be90f..32c45ec 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -95,20 +95,18 @@ Optimizations * :func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:`shutil.copytree` and :func:`shutil.move` use platform-specific - "fast-copy" syscalls on Linux, OSX and Solaris in order to copy the file more - efficiently. + "fast-copy" syscalls on Linux, macOS and Solaris in order to copy the file + more efficiently. "fast-copy" means that the copying operation occurs within the kernel, avoiding the use of userspace buffers in Python as in "``outfd.write(infd.read())``". - All other platforms not using such technique will rely on a faster - :func:`shutil.copyfile` implementation using :func:`memoryview`, - :class:`bytearray` and - :meth:`BufferedIOBase.readinto() <io.BufferedIOBase.readinto>`. - Finally, :func:`shutil.copyfile` default buffer size on Windows was increased - from 16KB to 1MB. - The speedup for copying a 512MB file within the same partition is about +26% - on Linux, +50% on OSX and +38% on Windows. Also, much less CPU cycles are - consumed. + 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 512 MiB file within the same partition is about + +26% on Linux, +50% on macOS and +40% on Windows. Also, much less CPU cycles + are consumed. + See :ref:`shutil-platform-dependent-efficient-copy-operations` section. (Contributed by Giampaolo Rodola' in :issue:`25427`.) * The default protocol in the :mod:`pickle` module is now Protocol 4, @@ -179,6 +177,14 @@ Changes in the Python API * The :class:`cProfile.Profile` class can now be used as a context manager. (Contributed by Scott Sanderson in :issue:`29235`.) +* :func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, + :func:`shutil.copytree` and :func:`shutil.move` use platform-specific + "fast-copy" syscalls (see + :ref:`shutil-platform-dependent-efficient-copy-operations` section). + +* :func:`shutil.copyfile` default buffer size on Windows was changed from + 16 KiB to 1 MiB. + CPython bytecode changes ------------------------ |