Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Single-run while makes script fast
- X-seq: zsh-workers 37309
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Single-run while makes script fast
- Date: Fri, 4 Dec 2015 09:43:31 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=jVz9KNCoA/Zfqt8hVO17RzRWZA9okmcAkn26WVgUrlE=; b=LiCOf0zKWZi1C2Ee+NX/zHBg+ae3+jDdbIgZYDjzy21L9kIu752w6GRgfd0BFCpRyJ O69hZQ9LQ/eOYZ0Sa+VaoEzoqzMIWurKz20dsoiyyvRgDZKD5Rdl3D7p2x8n7zMgtafs FuIJnKIXdUa7XUFL2cai7wXHWaqG8o8mzakuQv6Nl2bsvBUXOMFx3rbcb5wFhlS87z8/ VBT79E/MqXWNL4w41/5g/WCiRoy6Kigy9UcC190T06OiNST+vm9b7apkw9gXXViyNZff Of8JJbMdV3nhKrIOMGMvdk671Ar63AWsZyz5PV5YUBNd0kByLtQmhtmX6bcosBBwfWi1 iBHw==
- In-reply-to: <CAKc7PVAoYEZCJvpw-CF5=cbiZSeg3uO8FaJD2Ee6CkL71R+h4Q@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAoYEZCJvpw-CF5=cbiZSeg3uO8FaJD2Ee6CkL71R+h4Q@mail.gmail.com>
On Dec 4, 5:20pm, Sebastian Gniazdowski wrote:
}
} I attach animated gif showing the effect. The while loop in following
} code makes whole script fast:
By code examination rather than actual experiment --
The difference when the while-loop is introduced is that the entire
heap allocated by body=(...) is discarded with a single popheap() at
the "done", whereas without the loop the space is reclaimed by a call
to freeheap() which has to examine every heap arena.
You should be able to get the same effect with "repeat 1" so as not
to need the loop-counter variable.
This might indicate that the exec*() routines in Src/loop.c are not
doing as much as they could to keep memory footprint to its minimum.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author