Is it possible to use more than 1 CPUs during pkg create?

Chad J. Milios milios at
Tue May 30 10:55:12 UTC 2017

> On May 30, 2017, at 5:33 AM, Koichiro IWAO <meta at> wrote:
> Hi,
> is it possible to use more than 1 CPU cores during xz compression
> done in pkg create? I know XZ Utils in base system can use more
> than 1 CPUs if -T option given. I guess pkg internally calls APIs
> of XZ Utils. I think it is potentially possible.
> Or is it restricted to use only 1 CPU core for some reasons?
> -- 
> `whois | nkf -w`
> meta <meta at>

Threading forfeits a bit of xz’s great compression ratio. An xz file created with -T greater than 1 will necessarily be some amount larger. Operating with just one thread achieves the maximal compression ratio. (The multiple compression threads fail to share the dictionaries they are currently building.)

When you are transferring GBytes to yourself once, use -T0. When you are compressing something one time that hundreds or thousands of people will potentially download and/or store, use -T1 (the default).

More information about the freebsd-questions mailing list