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.
This commit is contained in:
Ludovic Courtès 2020-06-22 23:58:42 +02:00
parent 301527be8b
commit 2f6901c9df
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -290,7 +290,7 @@ (define build
#~(begin #~(begin
(use-modules (guix build utils) (guix build po) (use-modules (guix build utils) (guix build po)
(ice-9 match) (ice-9 regex) (ice-9 textual-ports) (ice-9 match) (ice-9 regex) (ice-9 textual-ports)
(ice-9 vlist) (ice-9 vlist) (ice-9 threads)
(srfi srfi-1)) (srfi srfi-1))
(define (translate-tmp-texi po source output) (define (translate-tmp-texi po source output)
@ -413,16 +413,18 @@ (define (available-translations directory domain)
(setenv "LC_ALL" "en_US.UTF-8") (setenv "LC_ALL" "en_US.UTF-8")
(setlocale LC_ALL "en_US.UTF-8") (setlocale LC_ALL "en_US.UTF-8")
(for-each (match-lambda (n-par-for-each (parallel-job-count)
((language . po) (match-lambda
(translate-texi "guix" po language ((language . po)
#:extras '("contributing")))) (translate-texi "guix" po language
(available-translations "." "guix-manual")) #:extras '("contributing"))))
(available-translations "." "guix-manual"))
(for-each (match-lambda (n-par-for-each (parallel-job-count)
((language . po) (match-lambda
(translate-texi "guix-cookbook" po language))) ((language . po)
(available-translations "." "guix-cookbook")) (translate-texi "guix-cookbook" po language)))
(available-translations "." "guix-cookbook"))
(for-each (lambda (file) (for-each (lambda (file)
(install-file file #$output)) (install-file file #$output))