Re: tar x cpu bound

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

>> qemu$ (pax -h; tar -h; xzcat ~/pkgsrc-HEAD.tar.xz) >/dev/null 2>&1
>
> Is that so that the pax and tar executables are paged in entirely?
>

A rather feeble and superfluous attempt, yes. (Didn't make much of a difference,
frankly.)

>> qemu$ time -p xzcat ~/pkgsrc-HEAD.tar.xz | tar -xf -; rm -rf pkgsrc
>> qemu$ time -p xzcat ~/pkgsrc-HEAD.tar.xz | pax -r 2>/dev/null; rm -rf pkgsrc
>
> That times xzcat(1) not pax(1) or tar(1), doesn't it?
>

Ah, that was bash, where the built-in time understands pipelines:

```
$ time -p echo hello | sleep 5
real 5.00
user 0.00
sys 0.00

$ /usr/bin/time -p echo hello | sleep 5
real 0.00
user 0.00
sys 0.00

$
```
-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.