From unknown Sun Jun 15 08:39:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#78432] [PATCH 1/2] channels: Speed up =?UTF-8?Q?=E2=80=98channel-news-for-commit=E2=80=99.?= 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, 14 May 2025 20:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78432 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78432@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Ian Eure , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org 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 submit@debbugs.gnu.org id=B.17472542549225 (code B ref -1); Wed, 14 May 2025 20:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 May 2025 20:24:14 +0000 Received: from localhost ([127.0.0.1]:46096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFIeD-0002Oc-9J for submit@debbugs.gnu.org; Wed, 14 May 2025 16:24:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56014) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFIeA-0002NT-Ey for submit@debbugs.gnu.org; Wed, 14 May 2025 16:24:11 -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 1uFIe4-00083L-Qy for guix-patches@gnu.org; Wed, 14 May 2025 16:24:05 -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 1uFIe4-0006SO-5o; Wed, 14 May 2025 16:24:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=BlNigzXycwlX5Nc/mdRj5/apnWXeAJRouV7Ps7v4kHo=; b=X7HfFuYYISWerz daIli+pPKysijFtx0kzOJzKdsCwIqzsoD61FHg5ziGy9/Q9dXGkdC1+bqWs1N/eTLiZoKNAQciz+1 8Y+y+cP3csLZzlaCWLtoqi4RUmZqMAF4NTO9s+lA+hWQW13gJ7Wk5F+40wvfV9q00e8bIzBXBz5WY sGvcBYhJCHIu4K9I8n89B0cHZM1iNC2LrrtgMU2najbX7dLWn4YdyS5O7LCYGDe6PIYQ2yO0CZKs3 PbVhrhm5Rn95an/JyfW4nkcSq3ApJauyLay6pLA2yYjdqUj4NpsNkPbnu0L7VEKB/8IT4omBuSyLt sMIq1kYzLhXy6KqoZkrg==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 14 May 2025 22:23:45 +0200 Message-ID: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Partly fixes . This makes the wall-clock time of: guix pull --list-generations > /dev/null shrink from 33s to 4s on a profile with 8 generations. * guix/channels.scm (channel-news-for-commit): Rewrite in terms of ‘commit-descendant?’. Reported-by: Ian Eure Change-Id: I387e3dc37437e2d98bfd7ab710417f68d16146ad --- guix/channels.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 7a02d24a84..f6b3f40cc3 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2018-2024 Ludovic Courtès +;;; Copyright © 2018-2025 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Brice Waegeneire @@ -31,7 +31,7 @@ (define-module (guix channels) #:autoload (git structs) (git-error-code) #:autoload (guix git) (update-cached-checkout url+commit->name - commit-difference + commit-descendant? repository-info commit-short-id tag->commit @@ -48,7 +48,6 @@ (define-module (guix channels) #:use-module (guix progress) #:use-module (guix derivations) #:use-module (guix diagnostics) - #:use-module (guix sets) #:use-module (guix store) #:use-module (guix i18n) #:use-module (srfi srfi-1) @@ -1237,15 +1236,16 @@ (define* (channel-news-for-commit channel new #:optional old) entry)) (channel-news-entries news)))) (if old - (let* ((new (commit-lookup repository (string->oid new))) - (old (commit-lookup repository (string->oid old))) - (commits (list->set - (map (compose oid->string commit-id) - (commit-difference new old))))) - (filter (lambda (entry) - (set-contains? commits - (channel-news-entry-commit entry))) - entries)) + (let ((new (commit-lookup repository (string->oid new))) + (old (commit-lookup repository (string->oid old)))) + (take-while (lambda (entry) + (let ((entry (commit-lookup + repository + (string->oid + (channel-news-entry-commit entry))))) + (and (commit-descendant? new (list entry)) + (not (commit-descendant? old (list entry)))))) + entries)) entries))) '()))) (lambda (key error . rest) base-commit: c5265b90b055ee15908298c5d463301f1aae2eb1 -- 2.49.0 From unknown Sun Jun 15 08:39:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#78432] [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0. 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, 14 May 2025 20:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78432 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78432@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 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 78432-submit@debbugs.gnu.org id=B78432.174725441111018 (code B ref 78432); Wed, 14 May 2025 20:27:01 +0000 Received: (at 78432) by debbugs.gnu.org; 14 May 2025 20:26:51 +0000 Received: from localhost ([127.0.0.1]:46115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFIgj-0002rI-19 for submit@debbugs.gnu.org; Wed, 14 May 2025 16:26:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34234) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFIgg-0002q4-Gx for 78432@debbugs.gnu.org; Wed, 14 May 2025 16:26:47 -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 1uFIgb-000785-6a; Wed, 14 May 2025 16:26:41 -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=zneLb/17FEaBMKi6Sm+RZAdKMErmSVOsl+cZYRHTj3I=; b=QBo3oaYVp9Ht1YLQ8967 3b0JcEFwclvC1ucl5ajIQh/xl0D5V1pxeqeWlL2PtpfnIXWLoMMLMN67IkKCw0yGdbGA6+2Lku4aW r/Zr7JPcfUnJkHMW7vY/8+PuWtrLh+6wYiqevvWOKpKvLjnrT0KyBdNBGMHn6fD7hr+m0OnD88Rbi CWDFTcRLKFEvIITU0gPWauodtQgj1k6eFT/zMca6LRSgUzKzLyXJsYlD+4aMyHKxsonVzJp0z1WAA +VEOwZpnKjkDi/0Pw7ASk2mT8OF75GMz0TpejAoQq7+JHKn8hvasoxpnKw22GLMyTpAvGJEAekPFe QeV84Hsmo1qsEA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 14 May 2025 22:26:28 +0200 Message-ID: <9b5150861b2dfdea534d00df8d1351d9f3a8a59c.1747254136.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> References: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/git.scm (commit-relation, commit-descendant?): Remove code for Guile-Git < 0.10.0. (set-git-timeouts): Remove code for Guile-Git < 0.9.0. (report-git-error): Remove code for ancient Guile-Git. Change-Id: Ie597151ce4c1e5ea006e2783fcc510caed3f566c --- guix/git.scm | 90 ++++++++++++++-------------------------------------- 1 file changed, 24 insertions(+), 66 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index 9975c9b92e..c1353c5c04 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -211,15 +211,9 @@ (define (set-git-timeouts connection-timeout read-timeout) when talking to remote Git servers. If one of them is #f, the corresponding default setting is kept unchanged." - ;; 'set-server-timeout!' & co. were added in Guile-Git 0.9.0. - (define (defined? variable) - (module-defined? (resolve-interface '(git)) variable)) - - (when (and (defined? 'set-server-connection-timeout!) - connection-timeout) + (when connection-timeout (set-server-connection-timeout! connection-timeout)) - (when (and (defined? 'set-server-timeout!) - read-timeout) + (when read-timeout (set-server-timeout! read-timeout))) (define* (clone* url directory #:key (verify-certificate? #t)) @@ -374,13 +368,7 @@ (define-syntax-rule (with-repository directory repository exp ...) (define (report-git-error error) "Report the given Guile-Git error." - ;; Prior to Guile-Git commit b6b2760c2fd6dfaa5c0fedb43eeaff06166b3134, - ;; errors would be represented by integers. - (match error - ((? integer? error) ;old Guile-Git - (leave (G_ "Git error ~a~%") error)) - ((? git-error? error) ;new Guile-Git - (leave (G_ "Git error: ~a~%") (git-error-message error))))) + (leave (G_ "Git error: ~a~%") (git-error-message error))) (define-syntax-rule (with-git-error-handling body ...) (catch 'git-error @@ -769,60 +757,30 @@ (define* (commit-difference new old #:optional (excluded '())) (cons head result) (set-insert head visited))))))) -(define commit-relation - (if (resolve-module '(git graph) #:ensure #f) ;Guile-Git >= 0.10.0 - (lambda (old new) - "Return a symbol denoting the relation between OLD and NEW, two commit +(define (commit-relation old new) + "Return a symbol denoting the relation between OLD and NEW, two commit objects: 'ancestor (meaning that OLD is an ancestor of NEW), 'descendant, or 'unrelated, or 'self (OLD and NEW are the same commit)." - (let ((repository (commit-owner old)) - (old (commit-id old)) - (new (commit-id new))) - (cond ((graph-descendant? repository new old) - 'ancestor) - ((oid=? old new) - 'self) - ((graph-descendant? repository old new) - 'descendant) - (else 'unrelated)))) - (lambda (old new) ;remove when Guile-Git 0.10.0 is widespread - (if (eq? old new) - 'self - (let ((newest (commit-closure new))) - (if (set-contains? newest old) - 'ancestor - (let* ((seen (list->setq (commit-parents new))) - (oldest (commit-closure old seen))) - (if (set-contains? oldest new) - 'descendant - 'unrelated)))))))) + (let ((repository (commit-owner old)) + (old (commit-id old)) + (new (commit-id new))) + (cond ((graph-descendant? repository new old) + 'ancestor) + ((oid=? old new) + 'self) + ((graph-descendant? repository old new) + 'descendant) + (else 'unrelated)))) -(define commit-descendant? - (if (resolve-module '(git graph) #:ensure #f) ;Guile-Git >= 0.10.0 - (lambda (new old) - "Return true if NEW is the descendant of one of OLD, a list of -commits." - (let ((repository (commit-owner new)) - (new (commit-id new))) - (any (lambda (old) - (let ((old (commit-id old))) - (or (graph-descendant? repository new old) - (oid=? old new)))) - old))) - (lambda (new old) ;remove when Guile-Git 0.10.0 is widespread - (let ((old (list->setq old))) - (let loop ((commits (list new)) - (visited (setq))) - (match commits - (() - #f) - (_ - ;; Perform a breadth-first search as this is likely going to - ;; terminate more quickly than a depth-first search. - (let ((commits (remove (cut set-contains? visited <>) commits))) - (or (any (cut set-contains? old <>) commits) - (loop (append-map commit-parents commits) - (fold set-insert visited commits))))))))))) +(define (commit-descendant? new old) + "Return true if NEW is the descendant of one of OLD, a list of commits." + (let ((repository (commit-owner new)) + (new (commit-id new))) + (any (lambda (old) + (let ((old (commit-id old))) + (or (graph-descendant? repository new old) + (oid=? old new)))) + old))) ;; -- 2.49.0 From unknown Sun Jun 15 08:39:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#78432] [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0. References: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> In-Reply-To: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 May 2025 16:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78432 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , 78432@debbugs.gnu.org, Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Christopher Baines Received: via spool by 78432-submit@debbugs.gnu.org id=B78432.174750081112363 (code B ref 78432); Sat, 17 May 2025 16:54:01 +0000 Received: (at 78432) by debbugs.gnu.org; 17 May 2025 16:53:31 +0000 Received: from localhost ([127.0.0.1]:50557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGKmw-0003DL-NZ for submit@debbugs.gnu.org; Sat, 17 May 2025 12:53:31 -0400 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]:42577) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGKmt-0003D0-KJ for 78432@debbugs.gnu.org; Sat, 17 May 2025 12:53:28 -0400 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id DEE5D11400C7; Sat, 17 May 2025 12:53:21 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sat, 17 May 2025 12:53:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm2; t=1747500801; x=1747587201; bh=RR WFDPjKsziqnSY9/DTVYaIQPN/ExF3H7tTd7+TnQ/A=; b=gSopf2f9aQJkKsVoCR Fo0tiUFlYIioTPatfddjv6oYKPnLvt//IimCymxsj4lKXjmbDTscLxNJT4AcTTPa +y7/SMoxA0Yhbp1u8hdshaZFS8Q3CqJnrQphfzc3VWYdCFOqx4rFvN7GTMl7QfqX uYmR5jucVk0kt/AA1/N4bN6Z2j7t0ofKnJZ2mT+whWC6WEnZAqbRPVOzVhRHockx rCj+fvMxlHahLusZYZ8q60eBCq6hRiXRfYnpBH1ZXjEhpGoRQLlyT/b4bDOiT1CZ 1A8GoTJl9wUjzsLN1VDrSqYWoS3l0pPH5wtwtOps+Z0Xx1MHNIfFPw2UIDshGAIW BLjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1747500801; x=1747587201; bh=RRWFDPjKsziqnSY9/DTVYaIQPN/E xF3H7tTd7+TnQ/A=; b=OmbpRq7wjZaJi6RnMJmiRwk2xoRJgeeVD405ABClH1fe 3ezMeDVsOaxO5QQZCrU8+uZwhhRlaPhZpKTcOv/Q5Uj9SfkBRX5C4FwWYtIxL7w3 FJ9Rk5495719LoPnV6+RNgvD5VJkO3qLbjemMHH9UAy45mN065WIAIucZpZEGrd7 cXjFqefdf+qLUPxXdYNG86Is+j15G69acBNaSuv7xTkuNh0UH/mM98a/rtf9ZNAf UkPk+LpWgwLRDeRbrreFxOpIXmdxka/bFucjRqfg2ayI1jChqd5/AmijqQ0C+ldU tfjFPRpTOGCWhV1Ufsd5zO6GrvyqE4UyZ9BLXqsdAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefudeiudeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefufgffkfggtgfgsehtqhertddtreej necuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggtrdhtvheqne cuggftrfgrthhtvghrnheptdetkeffffefiefhueekvdeiueegieegffdthfelveelgfdt vdfhtdduheffuedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhvpdhnsggprhgtphhtthhopeejpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehmvgesthhosghirghsrdhgrhdprhgtph htthhopeiiihhmohhnrdhtohhuthhouhhnvgesghhmrghilhdrtghomhdprhgtphhtthho pehothhhrggtvghhvgesghhnuhdrohhrghdprhgtphhtthhopeguvghvsehjphhoihhrvg htrdighiiipdhrtghpthhtohepghhuihigsegtsggrihhnvghsrdhnvghtpdhrtghpthht ohepjeekgeefvdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehluhguoh esghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 17 May 2025 12:53:20 -0400 (EDT) From: Ian Eure User-Agent: mu4e 1.12.9; emacs 29.4 Date: Sat, 17 May 2025 09:53:19 -0700 Message-ID: <875xhzfabk.fsf@retrospec.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Ludo=E2=80=99, Ludovic Court=C3=A8s writes: > * guix/git.scm (commit-relation, commit-descendant?): Remove=20 > code for > Guile-Git < 0.10.0. > (set-git-timeouts): Remove code for Guile-Git < 0.9.0. > (report-git-error): Remove code for ancient Guile-Git. Both patches LGTM! -- Ian From unknown Sun Jun 15 08:39:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#78432: closed (Re: [bug#78432] [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0.) Message-ID: References: <87v7pxk4z3.fsf@gnu.org> <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> X-Gnu-PR-Message: they-closed 78432 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 78432@debbugs.gnu.org Date: Sun, 18 May 2025 21:05:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1747602304-29618-1" This is a multi-part message in MIME format... ------------=_1747602304-29618-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #78432: [PATCH 1/2] channels: Speed up =E2=80=98channel-news-for-commit=E2= =80=99. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 78432@debbugs.gnu.org. --=20 78432: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78432 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1747602304-29618-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 78432-done) by debbugs.gnu.org; 18 May 2025 21:04:53 +0000 Received: from localhost ([127.0.0.1]:60989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGlBk-0007fe-Jz for submit@debbugs.gnu.org; Sun, 18 May 2025 17:04:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53190) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGlAN-0007a3-Lr for 78432-done@debbugs.gnu.org; Sun, 18 May 2025 17:03:28 -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 1uGlAI-0002Lc-02; Sun, 18 May 2025 17:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=FIudH9iUAY2C6879txMMIhobUfIP3CWf7/POWLFXXXM=; b=cpsiHgv8TK8BYnFxANVB Lo4AiruWZ+mGaWbWX2XNAwWDWuqO8cmEFyCF4y3yXSBkSs0/o/Q9PRXNVBbbysS+MDWb5J3bOnNqp JR92U6EkVQm42dQTwhrm7V+qAj7V7jyYqduRqRZMMVfnlsBUn+KY37dAfUpk8kptOroVeUf9oPxqm gozbm1jsViVs+zpzk8DZvhNeP7mf+Gai1NO6KQhnOnBX76qN5kol3VmJJqEEx5pFq9C7mccV1F4wK TCraSd1QFM1e4WZ5YW6WypdS6kqbtr2hjFeMwSw6++X9G3xUjeobA5sF74IqYBLKzepo3Ipp7E2lf DGdw5YexCttFMw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ian Eure Subject: Re: [bug#78432] [PATCH 2/2] git: Remove code for Guile-Git < 0.10.0. In-Reply-To: <875xhzfabk.fsf@retrospec.tv> (Ian Eure's message of "Sat, 17 May 2025 09:53:19 -0700") References: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> <875xhzfabk.fsf@retrospec.tv> Date: Sun, 18 May 2025 23:02:08 +0200 Message-ID: <87v7pxk4z3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78432-done Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , 78432-done@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ian Eure writes: > Both patches LGTM! Thanks for taking a look. Pushed: 86022e994e * git: Remove code for Guile-Git < 0.10.0. 6d6d897b54 * channels: Speed up =E2=80=98channel-news-for-commit=E2=80=99. Ludo=E2=80=99. ------------=_1747602304-29618-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 May 2025 20:24:14 +0000 Received: from localhost ([127.0.0.1]:46096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFIeD-0002Oc-9J for submit@debbugs.gnu.org; Wed, 14 May 2025 16:24:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56014) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFIeA-0002NT-Ey for submit@debbugs.gnu.org; Wed, 14 May 2025 16:24:11 -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 1uFIe4-00083L-Qy for guix-patches@gnu.org; Wed, 14 May 2025 16:24:05 -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 1uFIe4-0006SO-5o; Wed, 14 May 2025 16:24:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=BlNigzXycwlX5Nc/mdRj5/apnWXeAJRouV7Ps7v4kHo=; b=X7HfFuYYISWerz daIli+pPKysijFtx0kzOJzKdsCwIqzsoD61FHg5ziGy9/Q9dXGkdC1+bqWs1N/eTLiZoKNAQciz+1 8Y+y+cP3csLZzlaCWLtoqi4RUmZqMAF4NTO9s+lA+hWQW13gJ7Wk5F+40wvfV9q00e8bIzBXBz5WY sGvcBYhJCHIu4K9I8n89B0cHZM1iNC2LrrtgMU2najbX7dLWn4YdyS5O7LCYGDe6PIYQ2yO0CZKs3 PbVhrhm5Rn95an/JyfW4nkcSq3ApJauyLay6pLA2yYjdqUj4NpsNkPbnu0L7VEKB/8IT4omBuSyLt sMIq1kYzLhXy6KqoZkrg==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 1/2] =?UTF-8?q?channels:=20Speed=20up=20=E2=80=98channel-n?= =?UTF-8?q?ews-for-commit=E2=80=99.?= Date: Wed, 14 May 2025 22:23:45 +0200 Message-ID: <9d07f070500e61169450678b48983454508636f8.1747254136.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , Ian Eure X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Partly fixes . This makes the wall-clock time of: guix pull --list-generations > /dev/null shrink from 33s to 4s on a profile with 8 generations. * guix/channels.scm (channel-news-for-commit): Rewrite in terms of ‘commit-descendant?’. Reported-by: Ian Eure Change-Id: I387e3dc37437e2d98bfd7ab710417f68d16146ad --- guix/channels.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 7a02d24a84..f6b3f40cc3 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2018-2024 Ludovic Courtès +;;; Copyright © 2018-2025 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Brice Waegeneire @@ -31,7 +31,7 @@ (define-module (guix channels) #:autoload (git structs) (git-error-code) #:autoload (guix git) (update-cached-checkout url+commit->name - commit-difference + commit-descendant? repository-info commit-short-id tag->commit @@ -48,7 +48,6 @@ (define-module (guix channels) #:use-module (guix progress) #:use-module (guix derivations) #:use-module (guix diagnostics) - #:use-module (guix sets) #:use-module (guix store) #:use-module (guix i18n) #:use-module (srfi srfi-1) @@ -1237,15 +1236,16 @@ (define* (channel-news-for-commit channel new #:optional old) entry)) (channel-news-entries news)))) (if old - (let* ((new (commit-lookup repository (string->oid new))) - (old (commit-lookup repository (string->oid old))) - (commits (list->set - (map (compose oid->string commit-id) - (commit-difference new old))))) - (filter (lambda (entry) - (set-contains? commits - (channel-news-entry-commit entry))) - entries)) + (let ((new (commit-lookup repository (string->oid new))) + (old (commit-lookup repository (string->oid old)))) + (take-while (lambda (entry) + (let ((entry (commit-lookup + repository + (string->oid + (channel-news-entry-commit entry))))) + (and (commit-descendant? new (list entry)) + (not (commit-descendant? old (list entry)))))) + entries)) entries))) '()))) (lambda (key error . rest) base-commit: c5265b90b055ee15908298c5d463301f1aae2eb1 -- 2.49.0 ------------=_1747602304-29618-1--