Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14490 > unrolled thread

Re: Unexpected delay in using arguments.

Started byBize Ma <binaryzebra@gmail.com>
First post2018-08-14 23:00 -0400
Last post2018-08-14 23:00 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Unexpected delay in using arguments. Bize Ma <binaryzebra@gmail.com> - 2018-08-14 23:00 -0400

#14490 — Re: Unexpected delay in using arguments.

FromBize Ma <binaryzebra@gmail.com>
Date2018-08-14 23:00 -0400
SubjectRe: Unexpected delay in using arguments.
Message-ID<mailman.5123.1534302029.1292.bug-bash@gnu.org>
2018-08-14 11:25 GMT-04:00 Chet Ramey <chet.ramey@case.edu>:

> On 8/12/18 3:16 AM, Bize Ma wrote:
> > Try this script:
> (...)

> Which is a thousand times slower.
>
> If you build a profiling version of bash, you'll find that about 75% of
> that time is spent copying the list of arguments around


I just don't see why there is any need to copy arguments.
Most other shells seem that they don't do that.


> , since you have
> to save and restore it each time you call f1.


There is no need to "copy", that just waste additional memory.
Just point to a new list of arguments (it is a change of only a memory
pointer).
Release the memory when the argument list is not being used any more.



> > Bash 5 is even worse, try:
>
> Bash-5.0-alpha is not a released version, so it uses the debugging malloc.
> If you profile that, you'll find that about 99% of the time is spent
> marking allocations as active and free in the table the bash malloc uses
> to keep track of active memory.
>

Yes, tests with "--without-bash-malloc" and "RELSTATUS=release" were done
after I posted the OP.

Yes, version 5.0 is not corrected, and looks that it is not "worse".
Sorry for the  misrepresentation.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web