unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#43516] [PATCH core-updates] packages: Enable multi-threaded xz compression when repacking source.
@ 2020-09-19 17:03 Maxim Cournoyer
  2020-09-19 19:38 ` Leo Famulari
  0 siblings, 1 reply; 6+ messages in thread
From: Maxim Cournoyer @ 2020-09-19 17:03 UTC (permalink / raw)
  To: 43516; +Cc: Maxim Cournoyer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 1384 bytes --]

The xz compression is slow; using multiple threads/cores yields a linear
performance improvement.

* guix/packages.scm (patch-and-repack): Ensure xz is invoked with --threads=N
by setting the XZ_DEFAULTS environment variable.
---
 guix/packages.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/guix/packages.scm b/guix/packages.scm
index 6598bd3149..678007a807 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -693,6 +694,11 @@ specifies modules in scope when evaluating SNIPPET."
             (setenv "PATH" (string-append #+xz "/bin" ":"
                                           #+decomp "/bin"))
 
+            ;; Enable multi-threaded compression for xz.
+            (setenv "XZ_DEFAULTS" (string-append "--threads="
+                                                 (number->string
+                                                  (parallel-job-count))))
+
             ;; SOURCE may be either a directory or a tarball.
             (if (file-is-directory? #+source)
                 (let* ((store     (%store-directory))
-- 
2.28.0





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-09  2:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-19 17:03 [bug#43516] [PATCH core-updates] packages: Enable multi-threaded xz compression when repacking source Maxim Cournoyer
2020-09-19 19:38 ` Leo Famulari
2020-09-22  2:00   ` [bug#43516] Maxim Cournoyer
2020-09-22  2:00     ` [bug#43516] [PATCH core-updates v2] packages: Enable multi-threaded xz compression when repacking source Maxim Cournoyer
2020-09-22 15:19     ` [bug#43516] your mail Leo Famulari
2020-10-09  2:17       ` bug#43516: " Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).