bug-bash
[Top][All Lists]
Advanced

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

Re: Unexpected delay in using arguments.


From: Chet Ramey
Subject: Re: Unexpected delay in using arguments.
Date: Wed, 30 Jan 2019 14:20:49 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 1/1/19 9:57 PM, Bize Ma wrote:
> Chet Ramey (<address@hidden <mailto:address@hidden>>) wrote:
> 
>     It's in CWRU/CWRU.chlog in the development distributions
> 
> 
> I am sorry but I have been unable to find either the source code
> or the change log, either at the university site or by looking with google.

In the development distributions, always available at

http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-devel.tar.gz

Or you could just clone the git tree.

> 
> However, I have made some tests. Yes, the deeper internal delay
> with arguments have been removed. Running this code
> (from https://unix.stackexchange.com/q/462084/265604):

I'm going to assume you're running the pre-release distributions on a
Linux system where the debugging code in the bash malloc is enabled.

When I try timing the entire script on bash-5.0.2 (Mac OS X), adding `time'
calls before `f2 "$@"' and `main', I get

                args   = 1
1 function no   args yes real: 0.006
2 function yes  args yes real: 0.012
3 function yes  args no  real: 0.012

                args   = 20000
1 function no   args yes real: 0.006
2 function yes  args yes real: 0.012
3 function yes  args no  real: 0.013

real: 0.078
real: 0.503

real    0m0.529s
user    0m0.464s
sys     0m0.104s

which is comparable to ksh93, which produces

real    0m0.459s
user    0m0.349s
sys     0m0.107s

for the entire script.

So I'm comfortable saying there's no big performance issue here.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/



reply via email to

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