coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] uniq: avoid locking standard output when printing line count


From: Pádraig Brady
Subject: Re: [PATCH] uniq: avoid locking standard output when printing line counts with -c
Date: Mon, 29 Jun 2026 20:18:39 +0100
User-agent: Mozilla Thunderbird Beta

On 26/06/2026 05:11, Collin Funk wrote:
This increases throughput on systems with unlocked stdio functions.
E.g., 2.5x in the following case:

     $ timeout 1m taskset 1 shuf -r -i 0-100 \
         | taskset 2 uniq -c \
         | taskset 3 pv -r > /dev/null
     [ 100MiB/s]
     $ timeout 1m taskset 1 shuf -r -i 0-100 \
         | taskset 2 uniq -c \
         | taskset 3 pv -r > /dev/null
     [ 246MiB/s]

Nice speedup!
I wonder could we refactor to a shared numeric output routine.

thanks!
Padraig




reply via email to

[Prev in Thread] Current Thread [Next in Thread]