coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] true,false: avoid initialization overhead unless needed


From: Pádraig Brady
Subject: Re: [PATCH] true,false: avoid initialization overhead unless needed
Date: Mon, 07 Jul 2014 10:00:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 07/07/2014 09:48 AM, Bernhard Voelker wrote:
> This is a minor performance improvement:
> 
>   $ strace -fv /bin/true --xxx 2>&1 | wc -l
>   105
> 
>   $ strace -fv src/true --xxx 2>&1 | wc -l
>   26
> 
>   $ time for i in $(seq 1000) ; do /bin/true --xxx ; done >/dev/null
> 
>   real    0m5.083s
>   user    0m0.481s
>   sys    0m4.319s
> 
>   $ time for i in $(seq 1000) ; do src/true --xxx ; done >/dev/null
> 
>   real    0m4.729s
>   user    0m0.319s
>   sys    0m4.107s
> 
> 
> Do you think it's worth doing?

Not worth it IMHO since it slightly complicates the code
for this edge case where an argument is passed.
Also the true binary is only an edge case fall back itself.

thanks,
Pádraig.




reply via email to

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