Skip to content
Snippets Groups Projects
Commit f80a8b42 authored by Jannik Glückert's avatar Jannik Glückert Committed by Jonathan Wakely
Browse files

libstdc++: Also use sendfile for big files


We were previously only using sendfile for files smaller than 2GB, as
sendfile needs to be called repeatedly for files bigger than that.

Some quick numbers, copying a 16GB file, average of 10 repetitions:
    old:
        real: 13.4s
        user: 0.14s
        sys : 7.43s
    new:
        real: 8.90s
        user: 0.00s
        sys : 3.68s

libstdc++-v3/ChangeLog:

	* acinclude.m4 (_GLIBCXX_HAVE_LSEEK): Define.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* src/filesystem/ops-common.h (copy_file_sendfile): Define new
	function for sendfile logic. Loop to support large files. Skip
	zero-length files.
	(do_copy_file): Use it.

Signed-off-by: default avatarJannik Glückert <jannik.glueckert@gmail.com>
parent c4deccd4
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment