From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: efficiency
Date: Sat, 04 Feb 2017 09:39:48 -0800 [thread overview]
Message-ID: <5556c73b-f362-9bd5-e576-98e397005d56@eastlink.ca> (raw)
In-Reply-To: <20170204164701.7113b2ce@ntlworld.com>
On 04/02/17 08:47 AM, Peter Stephenson wrote:
> On Sat, 04 Feb 2017 08:38:52 -0800
> Ray Andrews <rayandrews@eastlink.ca> wrote:
>> Of course. Still it's good to understand the theory of the thing. As I
>> said, in practice the difference was a milisecond but I backed the wrong
>> horse, which is instructive since it suggests that the shell likes fewer
>> lines more than it likes simplified calculation.
> Yes, that does sound right. In an interpreted language quite a lot of
> the overhead is that you need to start from scratch on each line of
> input, working out what it is and passing through the hierarchy first of
> parsing and then execution. The math expression is interpreted, too,
> and has its own parsing and execution phases, but in a significantly
> more limited way. The actual time taken adding, subtracting and
> dividing to do the calculation within that is utterly trivial,
> I should think nearer nanoseconds than microseconds.
But the microseconds were for the entire function to execute several
times, which is far more than just the math.
>
> pws
>
Excellent, that's my lesson.
prev parent reply other threads:[~2017-02-04 18:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-04 2:55 efficiency Ray Andrews
2017-02-04 15:05 ` efficiency Peter Stephenson
2017-02-04 15:39 ` efficiency Ray Andrews
2017-02-04 15:47 ` efficiency Peter Stephenson
2017-02-04 16:38 ` efficiency Ray Andrews
2017-02-04 16:47 ` efficiency Peter Stephenson
2017-02-04 17:39 ` Ray Andrews [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5556c73b-f362-9bd5-e576-98e397005d56@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).