From patchwork Fri Jul 12 21:42:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. Arne Babenhauserheide" X-Patchwork-Id: 14627 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 01D4117216; Fri, 12 Jul 2019 22:44:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0DF9317217 for ; Fri, 12 Jul 2019 22:44:10 +0100 (BST) Received: from localhost ([::1]:52440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hm3Kq-00046e-Oi for patchwork@mira.cbaines.net; Fri, 12 Jul 2019 17:44:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53200) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hm3Kn-00045c-Lf for guix-patches@gnu.org; Fri, 12 Jul 2019 17:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hm3Kl-00069p-DE for guix-patches@gnu.org; Fri, 12 Jul 2019 17:44:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hm3Kk-000696-BW for guix-patches@gnu.org; Fri, 12 Jul 2019 17:44:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hm3Kk-0006PO-7I for guix-patches@gnu.org; Fri, 12 Jul 2019 17:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36630] [PATCH] guix: parallelize building the manual-database Resent-From: Arne Babenhauserheide Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Jul 2019 21:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36630 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36630@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156296779924538 (code B ref -1); Fri, 12 Jul 2019 21:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2019 21:43:19 +0000 Received: from localhost ([127.0.0.1]:40861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hm3K2-0006Ni-Os for submit@debbugs.gnu.org; Fri, 12 Jul 2019 17:43:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:38274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hm3K0-0006Na-V8 for submit@debbugs.gnu.org; Fri, 12 Jul 2019 17:43:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52943) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hm3Jz-0003qD-Tr for guix-patches@gnu.org; Fri, 12 Jul 2019 17:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hm3Jy-0005gA-Sn for guix-patches@gnu.org; Fri, 12 Jul 2019 17:43:15 -0400 Received: from mout.web.de ([217.72.192.78]:33057) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hm3Jw-0005dr-Po for guix-patches@gnu.org; Fri, 12 Jul 2019 17:43:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1562967788; bh=JSbsKdEiZ7UE+6euXjjDF1YUCnSrh1qriFSJCajp9WE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Reply-To; b=HoCYmKd1W4wBxRFYm8LJwncDR4fvwHBY4FaLxJ6UXivGXFx3ICocirIVphZV0HNGf 7WHyjjwSmIRZDdGhilPbhVzHrVAGZ+ai/OQK8XTXOfezPVc2jn49H68/x25PLI5eE8 jmISwfqE9tYTvswKN3c5po9m5rK34PTrS7hlafoA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from fluss.speedport.ip ([84.149.83.171]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MRlED-1hsoej20IT-00SuF8; Fri, 12 Jul 2019 23:43:08 +0200 From: Arne Babenhauserheide Date: Fri, 12 Jul 2019 23:42:45 +0200 Message-Id: <20190712214245.23857-1-arne_bab@web.de> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:M6QunW6vh03fYfPLecXtdY1IdXpj1J2+g7gqzxoq5hpplzKG1rj w1WR1Y/83NNBgPaIt91gT4b4JdYf27w5rrPSJDG4Wblhyaypo5MOGGij8a7m6jT1EU4qOnE WxI+RBQBWKUMHIY+GQYAdqbhXSdjKF7/9KZoLJ1LlKfxN+5a7u0PqoVSwNJ0FR/GB6M6DDf xq2cNNdlLw9TB0+MEltRA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Z4qCFm3X6ts=:tE0LYddfyeMyARB0+HN+N7 V4S/ZxVv0r/GKADlYF2UkWqdflqj2kIpgXuApr6PALMxwUe/flEeQZpuNffSUBnoQTZnryq4g 89CNK2YGk8l5lwck+deV+E+fsclC9z6TuVKqCZtLdHwwtjTCh4G955cYctvLKvFLNDlcT3aZ6 lxrQFWxt/aq/gjsgGeDd8z9n8AifbHOMrP62vgQeN/0A4E6ktisuM9YPCJj8D/p+b59/jFOe7 xD1eJAZ6nYwsKE0LeKFTv7DzL266J/x958RUYI5JfyrYiEH7BQebx2Ooelqy+HoZVTUyjNW9T hrreQkWR6AnlAnQ7e7aHV44zumDeZ1Y7OmjERZ8OjobZac3p7emjPX/HNXqzhZYQhLyVVDOI9 JWYIo9s/mVPhw3SwNA/5zbsx4OiKClv/tZfIbCrvOhBwpa5srz4kJfGJNpepUZARPdwBWhFzW qqdS3DkDhmrAdOfp4xRXLxH8P3NQugkxq4S4YVOarXiblg+pvWCp8v2WV5jJKAvn/ExQenBdh p6Vr9HljPxNZVEkXbyoNC9CSq5Ldq0KQOM381bRi0fvajoN68gtNe2WwWgePMqcNOiUejDD0m iZw5yMNrThofgPQMGfUJTaFBwC5Gbs2+XzlzRoAUmyyHsyS+M5xV8HELUB3NrzvSYwTtOu/UQ bfzQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arne_bab@web.de Cc: Arne Babenhauserheide Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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(-) -- 2.22.0 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"))