summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-22 23:58:42 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-23 00:03:08 +0200
commit2f6901c9df7d4fb2e0c0d67f9bb0bb4cabaf5a29 (patch)
tree8ad8773cf810473fab6d65b4ec25121c86ecdfaa
parent301527be8b5bed9e629aef1d9719a092f60d6b56 (diff)
self: Parallelize translation of the manual.
The guix-translated-texinfo.drv execution time goes from 1mn42s with 1 core to 1mn8s with 4 cores. * guix/self.scm (translate-texi-manuals)[build]: Use 'n-par-for-each' instead of 'for-each' for translation.
-rw-r--r--guix/self.scm24
1 files changed, 13 insertions, 11 deletions
diff --git a/guix/self.scm b/guix/self.scm
index 12727ddbae..e1350a7403 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -290,7 +290,7 @@ DOMAIN, a gettext domain."
#~(begin
(use-modules (guix build utils) (guix build po)
(ice-9 match) (ice-9 regex) (ice-9 textual-ports)
- (ice-9 vlist)
+ (ice-9 vlist) (ice-9 threads)
(srfi srfi-1))
(define (translate-tmp-texi po source output)
@@ -413,16 +413,18 @@ a list of extra files, such as '(\"contributing\")."
(setenv "LC_ALL" "en_US.UTF-8")
(setlocale LC_ALL "en_US.UTF-8")
- (for-each (match-lambda
- ((language . po)
- (translate-texi "guix" po language
- #:extras '("contributing"))))
- (available-translations "." "guix-manual"))
-
- (for-each (match-lambda
- ((language . po)
- (translate-texi "guix-cookbook" po language)))
- (available-translations "." "guix-cookbook"))
+ (n-par-for-each (parallel-job-count)
+ (match-lambda
+ ((language . po)
+ (translate-texi "guix" po language
+ #:extras '("contributing"))))
+ (available-translations "." "guix-manual"))
+
+ (n-par-for-each (parallel-job-count)
+ (match-lambda
+ ((language . po)
+ (translate-texi "guix-cookbook" po language)))
+ (available-translations "." "guix-cookbook"))
(for-each (lambda (file)
(install-file file #$output))