Collin Funk <[email protected]> writes:

> I said "two times faster", since that seems to be accurate in the
> majority of cases.
>
> However, you can see larger performance improvement than that with
> smaller numbers, since a larger proportion of the execution time will be
> spent trying to lock standard output versus converting/printing:
>
>     $ timeout 60 ./src/shuf-prev -i 0-1 -r | pv -r > /dev/null
>     [29.8MiB/s]
>     $ timeout 60 ./src/shuf -i 0-1 -r | pv -r > /dev/null
>     [ 110MiB/s]

Also, I noticed this invocation is missing from
tests/misc/write-errors.sh despite running forever when writes
succeed. I pushed the attach patch adding the test case.

I don't think any other 'shuf' invocations can be added since most
systems will run out of memory before having to write enough for a test
case.

Collin

>From c057266f15c5ff72673d6f8349ec633065d8566d Mon Sep 17 00:00:00 2001
Message-ID: <c057266f15c5ff72673d6f8349ec633065d8566d.1771734412.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Sat, 21 Feb 2026 20:16:43 -0800
Subject: [PATCH] tests: shuf: check that write errors are promptly diagnosed

* tests/misc/write-errors.sh: Add a shuf invocation that would run
forever if write errors weren't diagnosed.
---
 tests/misc/write-errors.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/misc/write-errors.sh b/tests/misc/write-errors.sh
index 20ba0ab1c..53111417a 100755
--- a/tests/misc/write-errors.sh
+++ b/tests/misc/write-errors.sh
@@ -56,6 +56,7 @@ paste /dev/zero
 pr /dev/zero
 pr --version; yes 1 | pr
 seq inf
+shuf -i 0-1 -r
 tail -n+1 -z /dev/zero
 tee < /dev/zero
 tr . . < /dev/zero
-- 
2.53.0

Reply via email to