[New-bugs-announce] [issue37159] Have shutil.copyfile() use copy_file_range()

Giampaolo Rodola' report at bugs.python.org
Wed Jun 5 01:24:51 EDT 2019


New submission from Giampaolo Rodola' <g.rodola at gmail.com>:

This is a follow up of issue33639 (zero-copy via sendfile()) and issue26828 (os.copy_file_range()). On [Linux 4.5 / glib 2.27] shutil.copyfile() will use os.copy_file_range() instead of os.sendfile(). According to my benchmarks performances are the same but when dealing with NFS copy_file_range() is supposed to attempt doing a server-side copy, meaning there will be no exchange of data between client and server, making the copy operation an order of magnitude faster.

Before proceeding unit-tests for big-file support should be added first (issue37096). We didn't hit the 3.8 deadline but I actually prefer to land this in 3.9 as I want to experiment with it a bit (copy_file_range() is quite new, issue26828 is still a WIP).

----------
components: Library (Lib)
files: patch.diff
keywords: patch
messages: 344671
nosy: giampaolo.rodola
priority: normal
severity: normal
status: open
title: Have shutil.copyfile() use copy_file_range()
type: performance
versions: Python 3.9
Added file: https://bugs.python.org/file48392/patch.diff

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37159>
_______________________________________


More information about the New-bugs-announce mailing list