coreutils
[Top][All Lists]
Advanced

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

Re: performance bug of `wc -m`


From: Assaf Gordon
Subject: Re: performance bug of `wc -m`
Date: Sun, 13 May 2018 10:54:41 -0600
User-agent: NeoMutt/20170113 (1.7.2)

Hello,

On Sun, May 13, 2018 at 09:05:47AM -0400, Peng Yu wrote:
> I am on Mac not on Linux. On Linux, I can confirm that `wc -m` is much
> faster than `wcm.py`.

As a first step, please run "wc --version" to confirm you are using
gnu coreutils' wc and not the macos native wc program.
 
> Here is the output on Mac.
> 
> $ seq 1000000 > num.txt
> $ time wc -m < num.txt
> 6888896
> 
> real    0m2.751s
> user    0m2.622s
> sys    0m0.042s
> $  time ./wcm.py < num.txt
> 6888896
> 
> real    0m1.401s
> user    0m1.234s
> sys    0m0.051s

Assuming it is coreutils' wc, I suspect file caching still plays
a significant role here.

Can you try:

   seq 1000000 | time wc -m
   seq 1000000 | time ./wcm.py

And report the timing ?

regards,
 - assaf



reply via email to

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