tar.xz on a Mac is 5× slower than it has to be
I benchmarked every format Purrchiver can write against the tool you’d
normally reach for on a Mac: the built-in tar, zip, and ditto, plus the
standard 7zz, xz, zstd, lz4, lzip, and brotli command-line tools.
Two machines, four data sets, every tool at its own default settings. The full
tables are on the benchmarks page.
Most of it is unremarkable, which is the result I wanted — an archive tool
should be at least as fast as the tools it replaces. But a few rows are worth a
closer look, and one of them is a trap almost everyone making .tar.xz files
on a Mac walks into.
tar.xz: the built-in tar uses one core
On a 170 MB mixed corpus:
| Machine | Purrchiver | built-in tar -cJf | |
|---|---|---|---|
| M2 Pro (8 performance cores) | 8.1 s | 45.7 s | 5.7× |
| M4 (4 performance cores) | 9.9 s | 53.3 s | 5.4× |
The output is the same size either way — 97.5% of the input — so this isn’t a quality trade. It’s threads.
The tar that ships with macOS (bsdtar 3.5.3) compresses xz on a single core.
It will accept --options xz:threads=0 without complaint, but in my testing it
isn’t any faster with it. Purrchiver splits the work across up to eight
threads at its default setting, leaving one core free.
The giveaway is the single-file numbers. Compressing one 32 MB stream,
Purrchiver and the standalone xz CLI land within a couple of percent of each
other — 6.25 s against 6.34 s on the M2 Pro — because current xz is
multithreaded by default too. The slow path isn’t xz. It’s tar -J.
If you live in Terminal, the fix is free. Install a current xz
(Homebrew’s is 5.8) and pipe into it instead of using -J:
tar -cf - project | xz > project.tar.xzRecent xz uses every core by default. It does that by splitting the input
into independent blocks, so the gain grows with the size of what you’re
compressing.
One wrinkle: the older M2 Pro finishes this job ahead of the newer M4 (8.1 s
vs 9.9 s). It has eight performance cores to the M4’s four, which is the likely
reason — but I wouldn’t lean on it. On incompressible data the M4 wins
tar.xz, and across the whole suite the two machines trade wins, which is why
the benchmarks page reports each one separately.
The headline number went down
In May the benchmarks page said tar.xz was about 7× faster. It’s about 5×
now. Purrchiver’s own time barely moved (8.2 s then, 8.1 s now). The built-in
tar got faster on the same corpus — 56.8 s down to 45.7 s — between
macOS 26.5 and 26.6.2. I don’t know what changed underneath it. The current
number is the one on the page.
Small files, and the metadata you didn’t ask for
The most practically useful result has nothing to do with compression.
Packing a folder of many small files — 2.3 MB in total — with no compression
at all, the built-in tar produced an archive 4.4× the size of its input.
Purrchiver’s came out at 1.9×.
The difference is AppleDouble. When creating an archive, macOS’s tar stores
each file’s extended attributes as a separate ._filename entry alongside it —
--mac-metadata is on by default. For a folder of small files, that metadata
can outweigh the files themselves. If you don’t need those attributes on the
other end, turn it off:
tar --no-mac-metadata -czf folder.tar.gz folderIt carries through to compressed formats. A .tar.gz of the same folder came
out at 7.9% of the input from the built-in tar against 2.6% from Purrchiver,
and took 1.12 s against 0.22 s.
ditto, the system’s default zip, has a similar habit: 56% of the input,
against 21.6% for Purrchiver — and 17.4% for the plain zip CLI, which brings
me to the next section.
Where Purrchiver loses
zipon small files. The plainzipCLI beats it on size (17.4% vs 21.6%) and on time (0.08 s vs 0.14 s).tar.zst. About 1.8× slower than the nativetarpath on the mixed corpus — 0.26 s against 0.14 s on the M2 Pro. Both are fast enough that you’d never notice, but it’s a loss.- Apple Archive on small files. 0.84 s against
aa’s 0.18 s. - 7z on small files. 0.26 s against
7zz’s 0.09 s on the M2 Pro. - ISO. The system’s own disk-image tool is faster on large data.
- ZIP archives over 4 GiB fall back to a correct but single-threaded path. Parallel Zip64 isn’t done yet.
One number that’s mostly about defaults
brotli comes out 25–33× faster in Purrchiver on incompressible data. That
looks dramatic and mostly isn’t. Purrchiver’s default setting uses Brotli
quality 9; the brotli CLI defaults to quality 11, its slowest and most
thorough. Comparing each tool at its own defaults is the right test for “what
do you get out of the box,” but this is the row where that framing does the
most work. Run the CLI at a lower quality and the gap mostly closes.
How it was measured
- Machines: a MacBook Pro with an M2 Pro (8 performance + 4 efficiency cores) and a Mac mini with an M4 (4 + 6), both with 16 GB of memory, both on macOS 26.6.2, both measured in September 2026.
- Same everything else: the same Purrchiver 1.0.1 build, byte-identical input data, and identical versions of every comparison tool — so the two machines differ in hardware and nothing else.
- Runs: serial, one compressor at a time on an otherwise idle machine, best of two.
- Data: highly compressible text, incompressible random data, a folder of many small files, and a large mixed corpus.
- Settings: every comparison tool at its own default; Purrchiver at its default, Normal.
Exact tool versions are listed on the benchmarks page, so you can time the comparison side yourself. The harness that drives Purrchiver’s engine isn’t public. If a number looks wrong to you, email corey@coreydaley.dev and I’ll re-check it.