From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cu15i-0002U8-JK for guix-patches@gnu.org; Fri, 31 Mar 2017 14:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cu15e-0007sr-7D for guix-patches@gnu.org; Fri, 31 Mar 2017 14:16:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cu15e-0007sg-2K for guix-patches@gnu.org; Fri, 31 Mar 2017 14:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cu15d-0006iq-R5 for guix-patches@gnu.org; Fri, 31 Mar 2017 14:16:01 -0400 Subject: bug#26316: Enable threaded compression of source tarballs Resent-Message-ID: From: Kei Kebreau References: <20170330221715.GA10357@jasmine> Date: Fri, 31 Mar 2017 14:15:36 -0400 In-Reply-To: <20170330221715.GA10357@jasmine> (Leo Famulari's message of "Thu, 30 Mar 2017 18:17:15 -0400") Message-ID: <87efxd5n3r.fsf@openmailbox.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Leo Famulari Cc: 26316@debbugs.gnu.org --=-=-= Content-Type: text/plain Leo Famulari writes: > This patch enables multi-threaded xz compression in the repacking stage > of building source tarballs. > > With it applied, I get a ~2.2x speedup building the source of > linux-libre with 4 threads, compared to 1 thread. > > Specifically, with the upstream linux-libre tarball in the page cache, > `guix build -S linux-libre` took ~366 seconds using a single thread for > xz, and ~164 seconds using 4 threads. > > From 78547a09e50440c649c3d28d7691f32fdd47cc25 Mon Sep 17 00:00:00 2001 > From: Leo Famulari > Date: Thu, 30 Mar 2017 03:10:48 -0400 > Subject: [PATCH] packages: Enable threaded compression of source tarballs. > > This provides a ~2x speedup when using 4 threads. > > * guix/packages.scm (patch-and-repack)[build]: Invoke xz with > '--threads=0' when re-packing tarballs. > --- > guix/packages.scm | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/guix/packages.scm b/guix/packages.scm > index 4bc4b017f..30be5bf38 100644 > --- a/guix/packages.scm > +++ b/guix/packages.scm > @@ -573,7 +573,12 @@ specifies modules in scope when evaluating SNIPPET." > #:fail-on-error? #t))))) > (zero? (apply system* > (string-append #+tar "/bin/tar") > - "cvfa" #$output > + "cvf" #$output > + ;; The bootstrap xz does not support > + ;; threaded compression (introduced in > + ;; 5.2.0), but it ignores the extra flag. > + (string-append "--use-compress-program=" > + #+xz "/bin/xz --threads=0") > ;; avoid non-determinism in the archive > "--mtime=@0" > "--owner=root:0" LGTM. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAljenMgACgkQ5qXuPBlG eg1Wgg//V2rtEkLIqUcujXU+bEAqkJI0EyLUUXo5N4RTgaDEaKABU939NPO9Z7GK mby7VeCu8xmJFU3zsHYqp+71dM1GgE3HQrKBKwAs4tz+flUKtjCg1c7eWvhQIz3s EhuQnW/mF+9mzjanSWz+DyqXPwgTTz2uWC9l3WJ1J1xf7Ko4AiSNRliEuQ5V1t4x JfWAUHpAeg6lx8LRqfpKD8vGcnMbKCPelcMmd7MTE8BIqY886A1mDQ5+i44LXfzm /bT7SujpHZKzBnkfSXT/Qqps70ZzOerXpozkYNVwXVWvufEWIYUnb0x8S4WXozW8 KQWqAIYH+Gdx8KIv0wtY6zdPYt89padXLcTf6O9mORF1BQvwjCYgGRnK+4THrtao jtlB28Qf0DX29H/5y0Enz6zNbIaCKTtSx3PvQNQ6PA8NvsJp78wwnuuLVP1Jp9xY LwIHpFyHZ4kg/OegPdjtMlEkr3WmwxBqwgdsyZLlJP/BT9aoY1YOmV5ag1K31YV6 m0T1pcGlu0B6bjN5VyUFM/CbLCb8ngECM2KHW/lafqnOEY44l532nBRY1tT7Ogas kEcjf9paNetlX+1avjs15WxeGbzCUvGGayYHt9+WTDgZfjNpqwM2tqsLXoaBVCtM g8fwC9nFj7lSYVkGfnZ9Yw6Spd4npZTpxGQQ0KWeMGvPVb6jTh0= =Gn6v -----END PGP SIGNATURE----- --=-=-=--