zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Is large `if' or `case' statement a potential cause of a slow-down?
Date: Wed, 13 Jun 2018 18:43:54 +0200	[thread overview]
Message-ID: <CAKc7PVAK=gr44XvTRMV6QCPRtAKGnZUF5E-DD8NehUX_c=_rAA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bRK8uhAQmZ3eOzszYGMrUj+vkQ1NcXcORRmwvbt8XkBg@mail.gmail.com>

On 13 June 2018 at 17:20, Bart Schaefer <schaefer@brasslantern.com> wrote:
> In my case it's because I don't presently have time to do more than
> toss off a quick one-line reply, and (aside from not being exactly
> sure what "big-loop" means), this needs a lot more depth.

Basing on FSH, such big-loop doesn't call functions. What emerges is
thus a long, non-structular code (IIRC, lack of meaningful functions
<=> no structural programming). It's like having one function that
does everything. Here one big-loop does everything. And it contains
other "does-everything" constructs, like big-ifs and big-cases. One
`case' in FSH code has 6 screens (30 lines each). Whole loop has 18
screens. That's why this is great, to decompose this big-loop, and
even gain (that much) performance. This also suggests that the answer
to the initial question is: yes, big if, case, etc. can harm
performance.

-- 
Best regards,
Sebastian Gniazdowski


  reply	other threads:[~2018-06-13 16:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 17:27 Sebastian Gniazdowski
2018-06-13 14:57 ` Sebastian Gniazdowski
2018-06-13 15:20   ` Bart Schaefer
2018-06-13 16:43     ` Sebastian Gniazdowski [this message]
2018-06-13 19:48   ` Sebastian Gniazdowski

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='CAKc7PVAK=gr44XvTRMV6QCPRtAKGnZUF5E-DD8NehUX_c=_rAA@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).