re: tar x cpu bound

RVP <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Wed, 14 May 2025, matthew green wrote:

> netbsd-8 uses pax-as-tar.  netbsd-9 and newer has bsdtar-as-tar.
>

Ah, never used 8.x, so I didn't know that...

> is this the real difference?  how dos "pax -r" work where tar is fast?
>

Works about the same in -HEAD (using the pkgsrc tarball which expands to ~1.4 GB
and which contains _many_ small files):

```
qemu$ uname -a
NetBSD qemu.local 10.99.14 NetBSD 10.99.14 (GENERIC) #0: Sat May 10 18:58:53 UTC 2025  [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC amd64

qemu$ cd /tmp

qemu$ (pax -h; tar -h; xzcat ~/pkgsrc-HEAD.tar.xz) >/dev/null 2>&1

qemu$ time -p xzcat ~/pkgsrc-HEAD.tar.xz | tar -xf -; rm -rf pkgsrc
real        23.43
user         5.87
sys          0.60

qemu$ time -p xzcat ~/pkgsrc-HEAD.tar.xz | pax -r 2>/dev/null; rm -rf pkgsrc
real        28.09
user         5.84
sys          0.40

qemu$
```

/tmp is a 2GB tmpfs (to remove any HW involvement).

-RVP
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.