Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is large `if' or `case' statement a potential cause of a slow-down?
- X-seq: zsh-workers 43002
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Is large `if' or `case' statement a potential cause of a slow-down?
- Date: Wed, 13 Jun 2018 18:43:54 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uh2P9BroNFGawyf+Iu+goUewOaRvfkMbd4zdwb9ZAvY=; b=lHgqt0ce0oNnftM3OUEA439eZRFce4MuAZVqvR3M8Mexc9vRGqxlFA6M0I8G9/TrvK bDw6OMgopgi6iP4RbsCZUVDFnRP2cfo2h+uZ5Vs2bN164A1tKu7qDVCnbhwj7CGYRWy8 j6n0WNalqP59NK7wy5GCi+ClBHhgo/F27RGF2MzAIMtCwSAJriXUI8ISHJaD5qzGa6Ol csXAOxAuk7vQWTYZRX9/T0LRl5SELYcdr21mb7vgEEbtMPEXj87iMoSF03pVT4TMhjBG h05FRTMp1MfQx4gaIbO3KeVq7uQKkXoa6B/Iw+rpZl80SQI1Fg9ubgdqMlFPnf7SaHKS vfWQ==
- In-reply-to: <CAH+w=7bRK8uhAQmZ3eOzszYGMrUj+vkQ1NcXcORRmwvbt8XkBg@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>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBLD7M-aFqy_jPHsmscst3n6XP+VnNZi_MBdLaLyUpMFw@mail.gmail.com> <CAKc7PVCatykwJ6LMeEPX3ossi29Qm-rzBErruiXDCJx9MQfQ+g@mail.gmail.com> <CAH+w=7bRK8uhAQmZ3eOzszYGMrUj+vkQ1NcXcORRmwvbt8XkBg@mail.gmail.com>
On 13 June 2018 at 17:20, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author