GNU bug report logs -
#36630
[PATCH] guix: parallelize building the manual-database
Previous Next
Reported by: arne_bab <at> web.de
Date: Fri, 12 Jul 2019 21:44:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
* guix/profiles.scm (manual-database): par-map over the entries. This
distributes the load roughly equally over all cores and avoids blocking on
I/O. The order of the entries stays the same since write-mandb-database sorts
them.
---
guix/profiles.scm | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index f5c863945c..374f0f8a90 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1312,15 +1312,11 @@ the entries in MANIFEST."
#~(begin
(use-modules (guix man-db)
(guix build utils)
+ (ice-9 threads)
(srfi srfi-1)
(srfi srfi-19))
- (define (compute-entries)
- ;; This is the most expensive part (I/O and CPU, due to
- ;; decompression), so report progress as we traverse INPUTS.
- (let* ((inputs '#$(manifest-inputs manifest))
- (total (length inputs)))
- (append-map (lambda (directory count)
+ (define (compute-entry directory count total)
(format #t "\r[~3d/~3d] building list of \
man-db entries..."
count total)
@@ -1330,8 +1326,16 @@ man-db entries..."
(if (directory-exists? man)
(mandb-entries man)
'())))
- inputs
- (iota total 1))))
+
+ (define (compute-entries)
+ ;; This is the most expensive part (I/O and CPU, due to
+ ;; decompression), so report progress as we traverse INPUTS.
+ (let* ((inputs '#$(manifest-inputs manifest))
+ (total (length inputs)))
+ (apply append (par-map compute-entry
+ inputs
+ (iota total 1)
+ (make-list total total)))))
(define man-directory
(string-append #$output "/share/man"))
--
2.22.0
This bug report was last modified 5 years and 49 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.