From patchwork Wed Apr 9 14:23:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41501 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8C8CA27BC4A; Wed, 9 Apr 2025 15:25:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 13CCC27BC49 for ; Wed, 9 Apr 2025 15:25:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u2WMi-0004D7-KY; Wed, 09 Apr 2025 10:25:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WMR-000476-Gd for guix-patches@gnu.org; Wed, 09 Apr 2025 10:25:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2WMR-0002yx-6S; Wed, 09 Apr 2025 10:25:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=CFWlQzJKg8wPYd056P1FcdvdSzjkzGQkiRf6938Wn6s=; b=o53ypc8NN6WsGW1DSQSikpzOzWh6Y4PQfE4WkCSbCB+vbmyXPJUQK+VDH6ntb8OQHrcRl4QV38h8sQeGYMBNCA2JruBOhPW2FvS0XdChxAgIZG17PEV0RFHx3Oh5XvNEbzxInbv9MxofKBCNkTLYccaA7G3kr5mrUxou1eSXHDFSJrnPF+mJ74zWnlUQrmCOZz1YIPcawS8CJc7XJq3uWyRDZ0dcevdiG0ag+WQyMe9ZCjdELX6yD0cuZtQkCq5b695azF71Lt9Z6PD9D2ZbdeYr9QwLljKw+Of7AinFAagkbnwDokj+bcNf8z/ev+NLizdhqrunvE+1ON0BlVMiBQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u2WMP-0007WL-PR; Wed, 09 Apr 2025 10:25:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77680] [PATCH 3/3] guix: Avoid =?utf-8?b?4oCYZmRhdGFzeW5j4oCZ?= call for caches and regular files. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 09 Apr 2025 14:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77680@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 77680-submit@debbugs.gnu.org id=B77680.174420864728769 (code B ref 77680); Wed, 09 Apr 2025 14:25:01 +0000 Received: (at 77680) by debbugs.gnu.org; 9 Apr 2025 14:24:07 +0000 Received: from localhost ([127.0.0.1]:40921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2WLV-0007Tc-R4 for submit@debbugs.gnu.org; Wed, 09 Apr 2025 10:24:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51672) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2WLN-0007SO-PI for 77680@debbugs.gnu.org; Wed, 09 Apr 2025 10:23:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u2WLI-0002ol-Fk; Wed, 09 Apr 2025 10:23:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=CFWlQzJKg8wPYd056P1FcdvdSzjkzGQkiRf6938Wn6s=; b=mOFSb/auaYJsYazw2gbe ske0hL8iqJqkCnMYVXKT5zD+oCzIS+gy99BnhK2yUBVp2Jb9DjF+s3Z5JkcwuOb9Ws2nuj1jMdc6T pvMjXDk/wgGQx3m6HHg8rlekNNR02mFn9oKfiCJHPVFCebd6aEF9jNzhj/YiIOFJC/1VhvxVaqh5k +cRIVft9LHqXAv2/3pXCFeEHy0Cx7IW3VwJCqjyH/b7N3oUN968ewUwtl3ChUd3Ix5h6ZI5xn0JX/ rfZK9pjP65NR7GWpJ9q4nGD/Z+b4BGJ4WcCBXHaU0w8ANTSzicDW1VCE8qF2JrUrtfHgbR7pPbo3h GjvYXoYpK4pGfg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 9 Apr 2025 16:23:38 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Fixes . Calling ‘fdatasync’ for each and every narinfo file created by ‘guix substitute’ proved to be too expensive on spinning HDDs and/or under load (from 0.1s to 1.3s for the ‘fdatasync’ call alone). * guix/git-authenticate.scm (cache-authenticated-commit): Pass #:sync? #f. * guix/http-client.scm (http-fetch/cached): Likewise. * guix/scripts/discover.scm (write-publish-file): Likewise. * guix/scripts/style.scm (format-whole-file): Likewise. * guix/substitutes.scm (cache-narinfo!): Likewise. Reported-by: Christopher Baines Change-Id: I82297eae737bc5aae8a3f7604119e9f3d4b625bf --- guix/git-authenticate.scm | 5 +++-- guix/http-client.scm | 5 +++-- guix/scripts/discover.scm | 3 ++- guix/scripts/style.scm | 5 +++-- guix/substitutes.scm | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/guix/git-authenticate.scm b/guix/git-authenticate.scm index 37c69d0880..3cd1175c32 100644 --- a/guix/git-authenticate.scm +++ b/guix/git-authenticate.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019, 2020, 2021, 2022 Ludovic Courtès +;;; Copyright © 2019-2022, 2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -344,7 +344,8 @@ (define (cache-authenticated-commit key commit-id) (chmod port #o600) (display ";; List of previously-authenticated commits.\n\n" port) - (pretty-print lst port)))))) + (pretty-print lst port))) + #:sync? #f))) ;;; diff --git a/guix/http-client.scm b/guix/http-client.scm index 9138a627ac..4e0cc59e91 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2018, 2020-2022 Ludovic Courtès +;;; Copyright © 2012-2018, 2020-2022, 2025 Ludovic Courtès ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2012, 2015 Free Software Foundation, Inc. ;;; Copyright © 2017 Tobias Geerinckx-Rice @@ -346,7 +346,8 @@ (define* (http-fetch/cached uri #:key (ttl (%http-cache-ttl)) text? (when cache-port (close-port cache-port)) (with-atomic-file-output file - (cut write-cache port <>)) + (cut write-cache port <>) + #:sync? #f) (close-port port) (open-input-file file)))) diff --git a/guix/scripts/discover.scm b/guix/scripts/discover.scm index 32bf6085a5..cbe01638f5 100644 --- a/guix/scripts/discover.scm +++ b/guix/scripts/discover.scm @@ -87,7 +87,8 @@ (define* (write-publish-file #:key (file (%publish-file))) (format port "http://~a:~a~%" (avahi-service-address service) (avahi-service-port service))) - %publish-services))) + %publish-services)) + #:sync? #f) (chmod file #o644)) (define* (read-substitute-urls #:key (file (%publish-file))) diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm index 4801529f7e..c45bdd4458 100644 --- a/guix/scripts/style.scm +++ b/guix/scripts/style.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021-2024 Ludovic Courtès +;;; Copyright © 2021-2025 Ludovic Courtès ;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. @@ -554,7 +554,8 @@ (define* (format-whole-file file order? #:rest rest) (apply pretty-print-with-comments/splice port lst #:format-comment canonicalize-comment #:format-vertical-space canonicalize-vertical-space - rest)))))) + rest)) + #:sync? #f)))) ;;; diff --git a/guix/substitutes.scm b/guix/substitutes.scm index 86b9f5472a..a7a2dda0dc 100644 --- a/guix/substitutes.scm +++ b/guix/substitutes.scm @@ -127,7 +127,8 @@ (define (cache-narinfo! cache-url path narinfo ttl) (mkdir-p (dirname file)) (with-atomic-file-output file (lambda (out) - (write (cache-entry cache-url narinfo) out)))) + (write (cache-entry cache-url narinfo) out)) + #:sync? #f)) narinfo)