From b129026e2e242e9068158ae6e6fcd8d7c5ea092e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 10 Dec 2022 10:56:48 +0100 Subject: deduplicate: Use 'sendfile' for small file copies. * guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile' instead of 'dump-port'. * tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"): New test. --- guix/store/deduplication.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm index ab982e3b3d..9953675319 100644 --- a/guix/store/deduplication.scm +++ b/guix/store/deduplication.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Caleb Ristvedt -;;; Copyright © 2018-2021 Ludovic Courtès +;;; Copyright © 2018-2022 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -262,7 +262,7 @@ (define (dump-and-compute-hash) (deduplicate file (dump-and-compute-hash) #:store store) (call-with-output-file file (lambda (output) - (dump-port input output size))))) + (sendfile output input size 0))))) (define* (copy-file/deduplicate source target #:key (store (%store-directory))) -- cgit v1.2.3