[arch-general] Multithreaded XZ
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 To All, Now that xz is multithreaded (not available in Arch Repos yet); I was wondering if package building and installing would, by default, utilize multiple threads. Regards, Mark -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlSXgRsACgkQZ/Z80n6+J/Yc6AD+ORs6WkeCmLwlpPEGF/TWGqBX D1YBmbZRocJ8YqtovT8A+wc9spnkCF37mD3WrTRTBs6cCyRDurCpMQX1ZUg87FpQ =sMcR -----END PGP SIGNATURE-----
On Sun, Dec 21, 2014 at 8:25 PM, Mark Lee <mark@markelee.com> wrote:
Now that xz is multithreaded (not available in Arch Repos yet); I was wondering if package building and installing would, by default, utilize multiple threads.
You can do it already - just set the environment variable XZ_OPTS="-T x" (where x is the number of threads) to support it once your xz upgrades. See man xz(1) under ENVIRONMENT. -te
On Mon, Dec 22, 2014 at 3:25 AM, Mark Lee <mark@markelee.com> wrote:
Now that xz is multithreaded (not available in Arch Repos yet); I was wondering if package building and installing would, by default, utilize multiple threads.
It won't, since the output of XZ in multi-threaded mode is different from single-threaded mode. This will break anything relying on getting repeatable output from compression. I'm not even sure it's possible to run XZ in multi-threaded mode with a single thread. xz -T1 uses single-threaded mode. xz -T1 --block-size=24M is also different from xz -T2 --block-size=24M. Multi-threaded decompression also requires a stream created using multi-threaded mode.
Jan Alexander Steffens <jan.steffens@gmail.com> on Mon, 2014/12/22 04:08:
On Mon, Dec 22, 2014 at 3:25 AM, Mark Lee <mark@markelee.com> wrote:
Now that xz is multithreaded (not available in Arch Repos yet); I was wondering if package building and installing would, by default, utilize multiple threads.
Sure. I do use the multi-threaded version since the end of 2011 with my xz-git package [0] from AUR. Worked perfectly since then.
It won't, since the output of XZ in multi-threaded mode is different from single-threaded mode. This will break anything relying on getting repeatable output from compression.
Yes, the output is different (and usually a little larger) for streams larger than block-size. But that does not matter. Every xz version can decompress every xz-compressed stream - including those created with multi-threaded xz. For Arch packages there is nothing that requires repeatable output. Building a package will generate new output one way or another - even a changed package file timestamp will change the output. Or did I get you wrong here?
I'm not even sure it's possible to run XZ in multi-threaded mode with a single thread. xz -T1 uses single-threaded mode. xz -T1 --block-size=24M is also different from xz -T2 --block-size=24M.
Multi-threaded decompression also requires a stream created using multi-threaded mode.
Yes. But it falls back to single-threaded mode without complaints. [0] https://aur.archlinux.org/packages/xz-git/ -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];) putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
On Dec 22, 2014 8:00 AM, "Christian Hesse" <list@eworm.de> wrote:
For Arch packages there is nothing that requires repeatable output.
Yes, there is. Package signatures are made using the compressed package. Delta packages work by patching the uncompressed package and then recompressing it. If the compressor works differently the verification of the product will fail. I'm not sure xdelta3 in smart enough to compensate, or if the needed information is even there.
Jan Alexander Steffens <jan.steffens@gmail.com> on Mon, 2014/12/22 08:07:
On Dec 22, 2014 8:00 AM, "Christian Hesse" <list@eworm.de> wrote:
For Arch packages there is nothing that requires repeatable output.
Yes, there is. Package signatures are made using the compressed package. Delta packages work by patching the uncompressed package and then recompressing it. If the compressor works differently the verification of the product will fail. I'm not sure xdelta3 in smart enough to compensate, or if the needed information is even there.
Ah, ok... Never used delta packages. You are right then. But the same applies for other compression options, no? How is gzip compression speed (-1...9 --fast --best) handled? -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];) putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
participants (4)
-
Christian Hesse
-
Jan Alexander Steffens
-
Mark Lee
-
Troy Engel