[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/09: pull: Speed up the new/upgraded package computation.
From: |
guix-commits |
Subject: |
04/09: pull: Speed up the new/upgraded package computation. |
Date: |
Tue, 12 Feb 2019 17:30:34 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 201253674bca6a1bf5d45e2af46fbb5c34f060bf
Author: Ludovic Courtès <address@hidden>
Date: Tue Feb 12 22:51:23 2019 +0100
pull: Speed up the new/upgraded package computation.
* guix/scripts/pull.scm (new/upgraded-packages): OLD no longer stores
all the versions of each package. Remove 'vhash-fold*' call and reduce
the number of 'version>?' calls when computing UPGRADED.
---
guix/scripts/pull.scm | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 408ff91..730b6a0 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -353,7 +353,13 @@ pairs, and return two values: the list of packages new in
ALIST2, and the list
of packages upgraded in ALIST2."
(let* ((old (fold (match-lambda*
(((name . version) table)
- (vhash-cons name version table)))
+ (match (vhash-assoc name table)
+ (#f
+ (vhash-cons name version table))
+ ((_ . previous-version)
+ (if (version>? version previous-version)
+ (vhash-cons name version table)
+ table)))))
vlist-null
alist1))
(new (remove (match-lambda
@@ -362,11 +368,10 @@ of packages upgraded in ALIST2."
alist2))
(upgraded (filter-map (match-lambda
((name . new-version)
- (match (vhash-fold* cons '() name old)
- (() #f)
- ((= (cut sort <> version>?) old-versions)
- (and (version>? new-version
- (first old-versions))
+ (match (vhash-assoc name old)
+ (#f #f)
+ ((_ . old-version)
+ (and (version>? new-version old-version)
(string-append name "@"
new-version))))))
alist2)))
- branch master updated (e2760d1 -> be4d840), guix-commits, 2019/02/12
- 01/09: pull: Use 'fold-available-packages' for the current package list., guix-commits, 2019/02/12
- 06/09: gnu: Add python-rope., guix-commits, 2019/02/12
- 09/09: gnu: Add python-language-server., guix-commits, 2019/02/12
- 07/09: gnu: Add python-jsonrpc-server., guix-commits, 2019/02/12
- 05/09: gnu: python2-rope: Change comment to reflect partial python3 support, guix-commits, 2019/02/12
- 03/09: pull: Move profile comparison to 'new/upgraded-packages'., guix-commits, 2019/02/12
- 04/09: pull: Speed up the new/upgraded package computation.,
guix-commits <=
- 02/09: inferior: Add 'inferior-available-packages'., guix-commits, 2019/02/12
- 08/09: gnu: Add python-docstyle., guix-commits, 2019/02/12