coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] seq: speed up the common case by 25x


From: Jim Meyering
Subject: Re: [PATCH] seq: speed up the common case by 25x
Date: Fri, 01 Apr 2011 11:53:23 +0200

Finally, getting to the choice of cut-off,
what do you think about making it larger than 1000, due to
the resource requirements involved in forking
a command (not to mention a 4-component pipeline)?

I tried increasing the threshold from 1000 to 100000
and got these numbers, both using the new code:

$ env time ./seq 99999 > /dev/null
0.01user 0.00system 0:00.01elapsed 85%CPU (0avgtext+0avgdata 2192maxresident)k
0inputs+0outputs (0major+163minor)pagefaults 0swaps
$ env time ./seq 100000 > /dev/null
0.00user 0.00system 0:00.00elapsed 187%CPU (0avgtext+0avgdata 4784maxresident)k
0inputs+0outputs (0major+1646minor)pagefaults 0swaps

With 99999, it uses your new recursive code and
takes the barely-measurable .01 second.
With one more line of output, it switches to using
the pipeline, which is slightly faster (on this multi-core system),
yet incurs about 10 times as many minor page faults.



reply via email to

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