[PATCH] gnu-build-system: Enable xz to decompress in parallel.

  • Done
  • quality assurance status badge
Details
3 participants
  • Efraim Flashner
  • Leo Famulari
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 6 years ago
(address . guix-patches@gnu.org)
20181206075615.4637-1-mail@cbaines.net
It can take a little while to decompress some packages with large xz
compressed source tar files. xz includes support for parallelism, so enable
this using the parallel job count for the overall derivation.

* guix/build/gnu-build-system.scm (unpack): Set XZ_OPT to pass the -T option
to xz to enable it to work in parallel if appropriate.
---
guix/build/gnu-build-system.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (26 lines)
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index e5f3197b0..9d11e5b1e 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -147,7 +147,7 @@ chance to be set."
locale (strerror (system-error-errno args)))
#t)))
-(define* (unpack #:key source #:allow-other-keys)
+(define* (unpack #:key source parallel-build? #:allow-other-keys)
"Unpack SOURCE in the working directory, and change directory within the
source. When SOURCE is a directory, copy it in a sub-directory of the current
working directory."
@@ -161,6 +161,10 @@ working directory."
(copy-recursively source "."
#:keep-mtime? #t))
(begin
+ (when parallel-build?
+ (setenv "XZ_OPT"
+ (format #f "-T~d" (parallel-job-count))))
+
(if (string-suffix? ".zip" source)
(invoke "unzip" source)
(invoke "tar" "xvf" source))
--
2.19.2
Christopher Baines wrote 6 years ago
(address . 33643@debbugs.gnu.org)
87pnufnkle.fsf@cbaines.net
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (4 lines)
> It can take a little while to decompress some packages with large xz
> compressed source tar files. xz includes support for parallelism, so enable
> this using the parallel job count for the overall derivation.

I'm guessing this is only suitable for core-updates, as it'll cause a
lot of rebuilds. I'm also not sure if it's worth it, but it does seem to
make building some packages at least start faster.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlwI2P1fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xe2Xg/9EVDJpU28AcK1fOhFNm8Jo1h0j6loey3ZTc74K7hjr9yMYyJ+TJvYkBb1
RCEp4eRxsjL47JQQb4GAuB3q1x9lyLGwFuvuHkG/e/TBelVAXXLF8snC5aP3HhOc
CULFbcK2TKdEbqG8IZS4Tr7nnTK3kOZHrzz1D+2DcrOMZL2tsQMJbveNRl3oSmWh
QRuRh4Djtn6+8san16fjUQhDl3TK2zXwgh5YzwMdpZqI43dVTqnXV1ypMOhO79op
p/eZVT0vV/XIgzAfo3UJFG1VRZEtgN3Vh1TUjmXYcZAezDnl8AvXmVi/j6jB8P9D
0rGPd0GuXrY/XZxjkQUeISv4VrzZqAm7sGE0hmZCFkSqHL4GSmMeyvObBjI8pi+s
ck0f18KlWrH3TmO6uPu70D2tRa7ZclqfkEAFW6EUTs1pF65xkQDwSP8UmxzOVwLg
3QR03K3t1BQpogAPExzFHyzXKnkK1JB+2ERK65gECAhUC3isIs8jzjFGtB2M785z
j22IR2Uy7K0+k1t1KI+WVVoKzYaECMVvib7hjTzlK0bnpciR24PAj1VGiQ2oZnH5
0nqgs2o33HPzmmod+KZfjyqq4N15DoJs+dThD6dg1AI0jKaahWDLADy7ldg98QkM
YuZKYkjPPm37ZwK3VWlGhmR8cL8MAi3Jn1lADDdUdcGzjBzMljY=
=gS3Q
-----END PGP SIGNATURE-----

Leo Famulari wrote 6 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 33643@debbugs.gnu.org)
20181206081352.GA31941@jasmine.lan
On Thu, Dec 06, 2018 at 07:56:15AM +0000, Christopher Baines wrote:
Toggle quote (4 lines)
> It can take a little while to decompress some packages with large xz
> compressed source tar files. xz includes support for parallelism, so enable
> this using the parallel job count for the overall derivation.

The xz man page says that multi-threaded decompression isn't implemented
yet, unfortunately.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlwI2jsACgkQJkb6MLrK
fwi1dw//e1LOv6SRdcQRXyHzDyIdkZDpJ/hIhB0QF3sHyv3Bn55Uw0ZlPO0y8+dF
oXuEn10ZFlidOph0IF1J+G9fEqkdEqAqRnZ578b2AM/1UlivryJFLeld5sz0Qmye
c2ZOWiLvzN0R9Baw0MiRwFjpfqafTq5Kx4jKkbWkG8uvwxFdUKEGLeF5AksfMIJU
p6p7+7Lq9/6Pk1Z9s68ZCIB+ugyj6CqP67fMK9DZ6v/TI2O1IzOrKOs7KXj1ww9y
BZVpCXI9W1dovDb4tTCziaxeOLtQhNefN0GQycubxy+dydAn29aAL3wQYbszg0vS
USiPWDjz572mI5ROGHMrBYxzschgvWkgfvD95Fup97KUp1nJrAX4X6MeY0SayS6m
edWNKY2h2U6DnXWEwqwE9t9+hPd/WKvCpgEoy0Y7mU2fwBpFjHVFz8Onn/w3vpUn
fEV9f/yl0zm++vuh6Gma1xpNp8uTFR9bQjqfaI0hFYdcgCLJi9sIvg3aNOEo7zyH
mD5yVG3kxc3BOhZqS6AYNTyDnz5xmRZy2Jk/1a1CjB15Cvzlcx78xxhKTf80zPa+
j63rBFauksoEk0lPXqRvBkvQdvTQbJOzvUjZ/TcltOljENc8IwZNcUt2QrNztN4i
V6nCYnUE9WIrt+9axhOVO3xHOgElZL5BPuTThfyXRS17F0fHRXA=
=HQ1Y
-----END PGP SIGNATURE-----


Christopher Baines wrote 6 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 33643@debbugs.gnu.org)
87o99yo382.fsf@cbaines.net
Leo Famulari <leo@famulari.name> writes:

Toggle quote (8 lines)
> On Thu, Dec 06, 2018 at 07:56:15AM +0000, Christopher Baines wrote:
>> It can take a little while to decompress some packages with large xz
>> compressed source tar files. xz includes support for parallelism, so enable
>> this using the parallel job count for the overall derivation.
>
> The xz man page says that multi-threaded decompression isn't implemented
> yet, unfortunately.

Ah, interesting. Having a read myself now, it also says it:

"will work on files that contain multiple blocks with size information
in block headers. All files compressed in multi-threaded mode meet
this condition, but files compressed in single- threaded mode don't
even if --block-size=size is used."

So, if -T was used to compress the data, then it sounds like it'll work
to decompress it. I guess this adds a little more uncertainty to the
benefit of this change, as the impact is dependent on the way the source
data is compressed.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlwJeq1fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfjuA/+JYvjr859j70wQsyAsuHlu+wkuCQuADaxdk5XAXmbMy2Mn4/mMTqpFT1S
svDdmFjPwECUG/wtuV0fAgT13g351AMykXKonLnYaAz5gwkJO1avhfdkbenOMZw/
6Qfd01hgPujP/dLZ630hE6oPaVsaYdSvgo4SYvOXTN2Q51gtASnLz7X92iX8L1cX
5C0qiqWr7OlWTuf81quTnrmOw8iUirhna5k++DY3UlEYhvWql8XGoWlWe4Kx+V41
8oKYm3XKrg+GqqfkCPlUDvRQIqYHMb65bFR/nzExgjRYgKOG+kYv2JQAsPlJTADi
5MKQNGJRBOtca06q0PAvYKpibyO5hKdxc29vF30mNj+91TBrlLBRItiGeeGSVD3m
W6yrv/u5uc6RyxYqSgTVGp5C29aY6zjkKCXNeuOqTDX9CqebLYQtut6Fk9EvuaiE
hf6SQcGU66mkTgKzmvEbLazctgzJpknOuPTSeebUj8M5r6EDL67FY6vzBH1ZHnK7
PO/91eMGqnHa9RHLgvKNZ42uQJLgBX5qv1WVHqn9xByYspwFjjf4HEzDbUHm+5HW
vcpOGLE2AYvM2mKH/jKKOYZf9iW11l+Y96Hm969XZHvXnJLW4FwzRQCO5/Kz3iMk
SvxmiDpt9qvAJ0PAo9vfCeP5O09L/dLKyVW286uGI4OH3gOmPXs=
=ITch
-----END PGP SIGNATURE-----

Leo Famulari wrote 6 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 33643@debbugs.gnu.org)
20181206210653.GA909@jasmine.lan
On Thu, Dec 06, 2018 at 07:38:21PM +0000, Christopher Baines wrote:
Toggle quote (5 lines)
> So, if -T was used to compress the data, then it sounds like it'll work
> to decompress it. I guess this adds a little more uncertainty to the
> benefit of this change, as the impact is dependent on the way the source
> data is compressed.

Right. When parallel decompression is implemented, I think we should
enable it in order to get some benefit from upstream tarballs that may
have been created with multi-threaded compression.

However, we probably won't be able to use the parallel compression
within Guix because it is apparently not deterministic:

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlwJj2kACgkQJkb6MLrK
fwiCQhAA4rGeNQ1PWm/23zpFcOKanr5Il9U6ppIY94BvLodzT+KfqTsCo2nH4AOg
dTWHViH8ArhHlQrre0f0gcKWddMal3Z45lVV5auVgLaU6L5AaFp0h7Xe8cN0Z+vy
HcC2E+XLTjOlZZTl2je9+69lxfNE48AtjIr4KfSwOhrOXdD7ahwNV7pLWSD8gc4u
1yT70guVTpNKp7qxUf/Vpv61avg2uy6LXCCIoR4lh8+EENTdwHqEDwh6EnFL8B2V
zOzLPrdqSdW8z6o4mLha8LHHFdwcSQZNQWtK0p1I1TGBdZTKk9T73Nr29qLUF8LI
iEQ5TH+VIaHDjDXNntJndBtmNdzROJSeul9c3QC0kL31YRg75EKQH9V3+rtScgU5
sHgiYZ9cMJiwYV0Gy9vLy3kZDQDjxdLCdsDMR+iG5q1N54c8ilWRw2vN24HDr3jD
bOOG6LwIQsBSD2NmiHPa4byzHHBoMXPQrDbR6OpKGjgKGwEEBNT703tCaiyfbgDY
8rUFsfmD7OcL/BIYc0jO54pwHy04Y01+tNfkZwZegNYc1LkfXspPQTzmxN+GXOQ+
4GjqcJqvz8uTE6GkfuxlMVDnq0CgcaN53n+zi+tzawXLftbPibDYh/xb8y9T+95I
EqckOmrlNcVx52w1NItR2ULEetOMSjm7x3q70LpXonEThhozZY4=
=fs3X
-----END PGP SIGNATURE-----


Efraim Flashner wrote 6 years ago
(name . Leo Famulari)(address . leo@famulari.name)
20181209143201.GA1307@macbook41
On Thu, Dec 06, 2018 at 04:06:53PM -0500, Leo Famulari wrote:
Toggle quote (15 lines)
> On Thu, Dec 06, 2018 at 07:38:21PM +0000, Christopher Baines wrote:
> > So, if -T was used to compress the data, then it sounds like it'll work
> > to decompress it. I guess this adds a little more uncertainty to the
> > benefit of this change, as the impact is dependent on the way the source
> > data is compressed.
>
> Right. When parallel decompression is implemented, I think we should
> enable it in order to get some benefit from upstream tarballs that may
> have been created with multi-threaded compression.
>
> However, we probably won't be able to use the parallel compression
> within Guix because it is apparently not deterministic:
>
> <https://bugs.gnu.org/31015>

If the tarball is compressed in parallel then it can be decompressed in
parallel.

As for compressing in parallel, it *might work* to pass it through our
non-bootstrap tar for 'tar --sort=name' and then pass it through xz
-T(pick-a-num).


--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlwNJ10ACgkQQarn3Mo9
g1ELVRAAllajPCkWXEEPQXn9pF4gHqjDzkf2N8mDNBKtd+iEILkv5QLlu+KaqPjJ
vcg+ZGPD6upDXu/FnGNTuLn4aOcsqJ6ESG6dmHPO0v2yOZXN7StqlggxMkobe2ZE
5MOwW1V49xbmsh9GQBysqqn+Yer81kX3gepw/E5o+fnOlZJXQtkQqtAju8fwl/rF
GSibFmRmq7rSdshFFH4fN+0WuIE1tIMTDJeATkX35l+hou6Y6nyg1GnzFwv6ItRx
uVrzp+6XrMxK594TrdJ9EPfuWDl3ElKY1dEiDLcZkDArzZQJm7VZG/ONERJ6KtrB
8cLb+hW0ASGKWNMegt4NwmpbGJdnwHbBccYJs38GgzmfQIfivVLiIApIbT9REoM7
UuRUCgQ64zK7FlAsMzbsfZb+r23Eh+tVpz76+LBP2vlI1iRH2evSjeVWLcA0Hz7S
loZeFT4sUN3Y2GO8GSawXzD8kSw2esg/mGSXtumfmiwL3VIe2xxahlfI/k6wOQtf
9qI5jJGybjoj0bopJSB2hLgsU7F5mCrbzN2tJqPcXSv/8uJ6tZTfaqeU2Y94jGPt
HwbCZz/ikfJuKPeAiUQfnI7cZ6YbguE8c4criyLBiVDKFYL+KLMM0ERSFJgmYtXE
lktAbnwMz8SdnN34lJVZORsF1KLbapk5NCWcyvkJvd801Rbsf7k=
=GGyt
-----END PGP SIGNATURE-----


Leo Famulari wrote 6 years ago
(name . Efraim Flashner)(address . efraim@flashner.co.il)
20181210162429.GA9407@jasmine.lan
On Sun, Dec 09, 2018 at 04:32:01PM +0200, Efraim Flashner wrote:
Toggle quote (3 lines)
> If the tarball is compressed in parallel then it can be decompressed in
> parallel.

The xz documentation says that parallel decompression is not
implemented? Is that no longer the case?

Toggle quote (4 lines)
> As for compressing in parallel, it *might work* to pass it through our
> non-bootstrap tar for 'tar --sort=name' and then pass it through xz
> -T(pick-a-num).

That could be helpful!
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlwOkzcACgkQJkb6MLrK
fwjnkRAAzP70xYA6VIbn7uIJTAgM40T/iuuUCq5WMdfeuh8b15mx04YJXYgSx4zR
i3YUoxeDSccXa36dW9yGckQdwU58pveQfId4e4D3Wwj017I3pSO+aRis/CaDL0a2
Kt29sNhb8l1LKlVMXzrFvDm4aKGN5FFJrw7eo2zYSNAFXmn4gjfxomv0kj0g0KeX
YOVxhDHiS9XSfrVdEcyOIROjI/eFKBw3uqjKYIVJBymUyFVPanN/A/9fdW8mHawp
cWIeTr9REpUeuFej8aU2UdDROcqj+pKh2UdcuKeOV5aWniEheSr3AKtmQOIfv8d8
UMi/O7AnTviASzfVSOBfvzXHoRo7ebbPRcM2lW9bKr2hsAQOPO6VOdPUfuqqPKld
mCgQGQYolj0+GKQP+eQTazi4LbErEQ0EzLTc4ZkmHfgqRQv8eXec2hPOP+Gj/ZJc
oAMUgUzSsPwsZPwdyjQbuMD21cqhXsP7xiysQvpJMo59llJK0cnNNXx5PwP4e0vH
KeC6ZhmHq2jZG+5vt9VxflNJxisutvSB2h6lH1ye8NIfNmF/ercwl0dL6f5uKK1i
B0ZjqGnb2+ROk/cLXxemfkWSDBrEE9WYLjU4VRVaR5uZlz4OkYn7Xa7X09Nhcuwu
7V2ZeaS81Kkxh8/00hSRFo6MN6PGEMVgrLGQBa6v7K1wnUXbB7Y=
=mQov
-----END PGP SIGNATURE-----


Efraim Flashner wrote 6 years ago
(name . Leo Famulari)(address . leo@famulari.name)
20181210184843.GA1323@macbook41
On Mon, Dec 10, 2018 at 11:24:29AM -0500, Leo Famulari wrote:
Toggle quote (7 lines)
> On Sun, Dec 09, 2018 at 04:32:01PM +0200, Efraim Flashner wrote:
> > If the tarball is compressed in parallel then it can be decompressed in
> > parallel.
>
> The xz documentation says that parallel decompression is not
> implemented? Is that no longer the case?

Looks like I got caught up with the original release notes.
Looks like it's specifically only compression.

Toggle quote (9 lines)
>
> > As for compressing in parallel, it *might work* to pass it through our
> > non-bootstrap tar for 'tar --sort=name' and then pass it through xz
> > -T(pick-a-num).
>
> That could be helpful!



--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlwOtQUACgkQQarn3Mo9
g1HAzA/6AtSY7TGrc1DjJyrZKjjvjRoPUL/j1875Zvp7gPYDkdI46TQPngS4+sxg
KWSEO4LFExteeld29OBtYH/tRJYQxzQv76hKLQEjdRXo3ITeJyVU7hB7T62FLZTe
bJyxLRDPTCjWNg+/hqsiUBERgN9tWkFryfHbfeBGJPcDgy81ONgZ6ZXjbPRtLscK
gIwlig14BhEScTopspiyy02n18xUs80fv8vAiDzdibAPr7gvsHGdjU3VN8uAbeUj
+LwHIUSBAn12hxtEcjzrbmlbRk8gDAXQ89z4h6LQloIfkfFXzsRs0enfZIil0I7o
8z9QJ31Vx/CRdPDJ3QpdQZvcWCUi/q3WcH0WLGDOuoC94mVCpEmrnvjrKOVwpZo9
mcKZTv97e40y0yJEJ7qrXpwKlZw/kvlc7WYhf+FGzd2z98Hha9DWvcH3OPZ7Quqa
/UmOmYHgm3Mm4uRgM3zbySDCZd7TpbhmThJFB+k8gwX5V/gQwCQ9UaMdShzAmVwP
J9AWZm/QNz7pHDyC+vsae1WsXWc2VsAOL5Nv3hP8zokmw73p/62RGMl4+IUZgELn
KAJu3Cu01ioTMeOJGUPO2jfDNLopVBzQ+pgOMVCAyiV0UNcOu52Q8/FzMkpZcdaK
v6Z2r3BByuPVGIsmKeZ1zXKx2WnJKPQ6PaBA8uzRAbBDEtP6kCM=
=OBRF
-----END PGP SIGNATURE-----


Christopher Baines wrote 5 years ago
(address . 33643@debbugs.gnu.org)
87k11fofxj.fsf@cbaines.net
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (35 lines)
> It can take a little while to decompress some packages with large xz
> compressed source tar files. xz includes support for parallelism, so enable
> this using the parallel job count for the overall derivation.
>
> * guix/build/gnu-build-system.scm (unpack): Set XZ_OPT to pass the -T option
> to xz to enable it to work in parallel if appropriate.
> ---
> guix/build/gnu-build-system.scm | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
> index e5f3197b0..9d11e5b1e 100644
> --- a/guix/build/gnu-build-system.scm
> +++ b/guix/build/gnu-build-system.scm
> @@ -147,7 +147,7 @@ chance to be set."
> locale (strerror (system-error-errno args)))
> #t)))
>
> -(define* (unpack #:key source #:allow-other-keys)
> +(define* (unpack #:key source parallel-build? #:allow-other-keys)
> "Unpack SOURCE in the working directory, and change directory within the
> source. When SOURCE is a directory, copy it in a sub-directory of the current
> working directory."
> @@ -161,6 +161,10 @@ working directory."
> (copy-recursively source "."
> #:keep-mtime? #t))
> (begin
> + (when parallel-build?
> + (setenv "XZ_OPT"
> + (format #f "-T~d" (parallel-job-count))))
> +
> (if (string-suffix? ".zip" source)
> (invoke "unzip" source)
> (invoke "tar" "xvf" source))

It's been a long long while, but now that core-updates has recently been
merged, I'd like to try and take a look at this again.

I think the consensus was that this will only help for xz compressed
files where they have been compressed in parallel. I think it's still
worth doing though, as some of the big xz files that need decompressing
have been compressed in parallel, and this will speed up the builds when
multiple cores are available.

Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl68OlhfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XeIIg//Ttm908GW5504QVqslK2vaUE2acDsgqHjmlsv7ykIKFThXtUp54VKQ5JT
wOZl8OV+0HCpQDxF+wTONjGwDjE9eAyFMuyFbF6JKcVu5GNSgd+SbZdwcGBQAKM3
JYY990M6JZiiPwuuXsonLYYv46I8Lb46Jp8Oc7dogOsXXVrF3UZFIL+9pBFQlBco
D4gebtkMMTLvTXsm5/pzL+rpRWHudvuBKf9ogBsd+hsKOCFIOLPTF1A0WE3Twrnm
VKZ+j7SCqGmKfVkJL+a3Df5ln+fKHX7Yav8XGiYkfSI7LXPg3sJhq1/CDMBAy6O5
7KAFptf/msw7atgc4hazB2Aah7E2o230Gdu86HDy9Dbom0sd6sq6s7F1ICGvcv9C
xt/COIetlMXDhnsbvpFL/lmh3kxDPk78sFaHkUfd4fbT4+9nHIXVL03AtWqFOYgF
OiChboA8Eh8+vnaMuXwbE9o1O84+E9/o4RuaH3OS6RlDDBp62FC/4bQBhvLagSEH
BD1erdFPVzJKV0amSfHExGTrQ/PL9Cov9CgEmWrKE0pPCcZWXbLc0pa7SkXR+jyE
xqe1wDQDK4xeOG16sEMurZLgNbSD1ZfRPOoI/jIRbKkrmJtKZqAbAEFi8y6R+Xow
QHbq776aESqqV9/x10QHE0mb4sJaoXFTfMc4zrJw9HLwQvUUSMo=
=+wNy
-----END PGP SIGNATURE-----

Efraim Flashner wrote 5 years ago
(name . Christopher Baines)(address . mail@cbaines.net)
20200513190721.GH918@E5400
On Wed, May 13, 2020 at 07:20:08PM +0100, Christopher Baines wrote:
Toggle quote (51 lines)
>
> Christopher Baines <mail@cbaines.net> writes:
>
> > It can take a little while to decompress some packages with large xz
> > compressed source tar files. xz includes support for parallelism, so enable
> > this using the parallel job count for the overall derivation.
> >
> > * guix/build/gnu-build-system.scm (unpack): Set XZ_OPT to pass the -T option
> > to xz to enable it to work in parallel if appropriate.
> > ---
> > guix/build/gnu-build-system.scm | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
> > index e5f3197b0..9d11e5b1e 100644
> > --- a/guix/build/gnu-build-system.scm
> > +++ b/guix/build/gnu-build-system.scm
> > @@ -147,7 +147,7 @@ chance to be set."
> > locale (strerror (system-error-errno args)))
> > #t)))
> >
> > -(define* (unpack #:key source #:allow-other-keys)
> > +(define* (unpack #:key source parallel-build? #:allow-other-keys)
> > "Unpack SOURCE in the working directory, and change directory within the
> > source. When SOURCE is a directory, copy it in a sub-directory of the current
> > working directory."
> > @@ -161,6 +161,10 @@ working directory."
> > (copy-recursively source "."
> > #:keep-mtime? #t))
> > (begin
> > + (when parallel-build?
> > + (setenv "XZ_OPT"
> > + (format #f "-T~d" (parallel-job-count))))
> > +
> > (if (string-suffix? ".zip" source)
> > (invoke "unzip" source)
> > (invoke "tar" "xvf" source))
>
> It's been a long long while, but now that core-updates has recently been
> merged, I'd like to try and take a look at this again.
>
> I think the consensus was that this will only help for xz compressed
> files where they have been compressed in parallel. I think it's still
> worth doing though, as some of the big xz files that need decompressing
> have been compressed in parallel, and this will speed up the builds when
> multiple cores are available.
>
> Thanks,
>
> Chris

I thought the last time we looked into this we figured out that there
was a mistake in release notes or something and that parallel
decompression isn't actually supported.

--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl68RWYACgkQQarn3Mo9
g1Gl6RAAoR1+UxXRaKzafGqbc6dT/zc1zHYdanoa3NWt5EEGiAiKBaEnU1RW1K16
4xYJYfzm4w+FChnp1+Buj6n85cdiGpZLst6mY4KV8qPgYJoZJLi7QRN+06AZ92Lo
mgD0479QJhRe0iEwtRXk+pjhEt13xOaSv2TTY5L8cRKHT16GVQhzTmD+kgLBCEiS
k3qxjP9hOfGFl5myNReHeFcCVb8jJpDl86MmNqvJTuja7ylEW0g92ujF9JfMs2af
m+h7pEtB4GGeDSfAoGIUhLrr8hN6VmiRLcbladkabeZ3ySFdQ669qkxcefGQ11HR
C5eu8Ac8b0gJ7CMjFzrXQeW76GvDrq9u+RhyhlJ3EQqa8rAkvOodUXtuh4WhFbfW
CZN/qWtO4Vs8BQ4svuJ3oWLjqmu8HhunU7JYCyI09uVKL45pHjz14WBLOmUGvplr
oOIvv6z4k/C3HFihrC6zt8DcjuXXpfr51VC3Z7PcleFx6JmduhSRAOfTsat6SP61
+vGtSl75m8zCOxpwgj4zmk0w9efiPaxFgTDHLtz7ZnZbNeReUvfiFcTJRNg8UMQC
tH4Uj90eduNDQ50VDJrv6b5Fn+Wmu1tg1MwzcPPuyMVCO4n/0C+cO3qya7FpLZ1m
orTniX4rFGc4AMotCPQNWLgjJzgpjMS3UjgWnnDZg11TyNm832A=
=XTqp
-----END PGP SIGNATURE-----


Christopher Baines wrote 5 years ago
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 33643-done@debbugs.gnu.org)
87ftc3nezv.fsf@cbaines.net
Efraim Flashner <efraim@flashner.co.il> writes:

Toggle quote (56 lines)
> On Wed, May 13, 2020 at 07:20:08PM +0100, Christopher Baines wrote:
>>
>> Christopher Baines <mail@cbaines.net> writes:
>>
>> > It can take a little while to decompress some packages with large xz
>> > compressed source tar files. xz includes support for parallelism, so enable
>> > this using the parallel job count for the overall derivation.
>> >
>> > * guix/build/gnu-build-system.scm (unpack): Set XZ_OPT to pass the -T option
>> > to xz to enable it to work in parallel if appropriate.
>> > ---
>> > guix/build/gnu-build-system.scm | 6 +++++-
>> > 1 file changed, 5 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
>> > index e5f3197b0..9d11e5b1e 100644
>> > --- a/guix/build/gnu-build-system.scm
>> > +++ b/guix/build/gnu-build-system.scm
>> > @@ -147,7 +147,7 @@ chance to be set."
>> > locale (strerror (system-error-errno args)))
>> > #t)))
>> >
>> > -(define* (unpack #:key source #:allow-other-keys)
>> > +(define* (unpack #:key source parallel-build? #:allow-other-keys)
>> > "Unpack SOURCE in the working directory, and change directory within the
>> > source. When SOURCE is a directory, copy it in a sub-directory of the current
>> > working directory."
>> > @@ -161,6 +161,10 @@ working directory."
>> > (copy-recursively source "."
>> > #:keep-mtime? #t))
>> > (begin
>> > + (when parallel-build?
>> > + (setenv "XZ_OPT"
>> > + (format #f "-T~d" (parallel-job-count))))
>> > +
>> > (if (string-suffix? ".zip" source)
>> > (invoke "unzip" source)
>> > (invoke "tar" "xvf" source))
>>
>> It's been a long long while, but now that core-updates has recently been
>> merged, I'd like to try and take a look at this again.
>>
>> I think the consensus was that this will only help for xz compressed
>> files where they have been compressed in parallel. I think it's still
>> worth doing though, as some of the big xz files that need decompressing
>> have been compressed in parallel, and this will speed up the builds when
>> multiple cores are available.
>>
>> Thanks,
>>
>> Chris
>
> I thought the last time we looked into this we figured out that there
> was a mistake in release notes or something and that parallel
> decompression isn't actually supported.

Hmm, I had a look to see if I could find some examples of where this
would apply, but I couldn't find any xz archives that we use in Guix
where it's been compressed in a way that allows multithreaded
decompression...

I'm pretty sure I had some examples before, but maybe somethings changed
in the intervening year.

Anyway, if I discover this again, I'll actually make a note of where
it's applicable.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl689VRfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfLAw/+OaHGFflhFa8gpk0UfmZwBA7ZuZBuDEIycWyMsKnisG3suwOPZkDbTIZQ
/gx5BCwZKXAEXkVCenRQURzDpTx6jzUsRGQtUo+7dO9lb1RPu+URaQYZqxtmkix5
hT0k7I1J0cI1EVYoKjf8V0pQoMKZ0fwEU6LlJqVdeVJkWJ2lO/YiY9ehjkaRfC8O
twqLcxJt7E93EFzOZUKk/fSFO4U6CO1y5HfyFHOsCJpZ6Wv1KAW06Zjxl4dKXAQL
oGpZ/O8KH9958wRZneyXCpaHjRFCNABQIRkDceMiAS70uFJhZ8XVb/1b/O13kEBz
TMiVRE+nicpg4UKDKRI/ljfwtwvhAVSBXJ0Q4x8oq3jdvOAa1Ax7hKrqUV2BaRBD
hn517EaaZschp8QjsoudgHNzf1V+bwD1eKrDuLmrIoo2ObCCmPCsJoMqdnEXZ16S
yAu1cdtIoQs45P+Q0cuVywPfoI+pjTD8jlKBo5VK3HhfYWB20YFupSyQbZCRLEwW
AjmfFUknkjLxlRt5h9im11GrRup2XEv0sI0A0BWm/Jo1ebSwxywgVh0a0GegcQhK
gQb9z41b3hpP3yCW8QwisRlPR4Iy44sm8iRfPGpVfmgaccJfx9dVi9q+lMekt5cG
bIEIDhQQo5ONW+Y38r7BhFK78TimI7yKvMrH6RxobnxZklkVblg=
=eiqL
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 33643@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 33643
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help