From: "Jesper Nygårds" <jesper.nygards@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Extended globbing seems to have become much slower in recent versions of Zsh
Date: Mon, 7 Mar 2016 10:59:31 +0100 [thread overview]
Message-ID: <CABZhJg8R05T7_=3UTETvsvQixt+g60ZvGdc=PpMCSq43-FJdCQ@mail.gmail.com> (raw)
In-Reply-To: <20160306181009.412c31be@ntlworld.com>
[-- Attachment #1: Type: text/plain, Size: 2173 bytes --]
I see no real difference with or without Peter's patch, I'm afraid.
I will incorporate the suggestions from Bart in my solution. But I feel I
haven't explained very well (or at all) what I'm trying to achieve. I use
this kind of globbing in a sort of "recursive grep" which I use
interactively to grep in my project's codebase. The inputs to the script
include both patterns that I search for and patterns that I want to
exclude. Up until now, I have composed the list of exclusions from the
input without separating ordinary files from directories, but Bart's tip
made me aware that such a separation would be worth doing to make it faster.
As a side note, since I have implemented this in zsh, I followed what I
thought was "zsh best practice", and composed this rather complicated file
list with a zsh glob expression, instead of relying on an external command
such as gnu "find". But after I discovered this bottle neck in my scripts,
I have experimented with instead letting "find" find the files, and indeed
that seems a whole lot faster. I mention that just to be sure that I am not
causing you to waste your time if my use case is so extreme that it's not
worth bothering about its performance.
On Sun, Mar 6, 2016 at 7:10 PM, Peter Stephenson <
p.w.stephenson@ntlworld.com> wrote:
> On Sat, 5 Mar 2016 09:47:23 -0800
> Bart Schaefer <schaefer@brasslantern.com> wrote:
> > On Mar 4, 9:49pm, Peter Stephenson wrote:
> > } Subject: Re: Extended globbing seems to have become much slower in
> recent
> > }
> > } This is what I meant. It may not be related to the slow down in
> > } question, but it should speed up repeated use of exclusion patterns in
> > } any case.
> >
> > Sadly, on my desktop this actually SLOWS DOWN the process even further.
> > The below is for a glob of 13,000 files (largest/deepest tree I have
> > handy) with "repeat 3" and Jesper's pattern:
>
> That suggests either I've made a mistake in the optimisation portion
> (which I didn't explicit test, only that it gave the correct behaviour),
> or the repeated allocation ad nfreeing of similar length strings is
> close to optimal in allocation already... or a combination.
>
> pws
>
next prev parent reply other threads:[~2016-03-07 9:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-28 20:18 Jesper Nygårds
2016-02-29 19:12 ` Bart Schaefer
2016-03-01 11:39 ` Jesper Nygårds
2016-03-01 18:28 ` Bart Schaefer
2016-03-01 19:11 ` Jesper Nygårds
2016-03-02 0:03 ` Bart Schaefer
2016-03-02 8:39 ` Jesper Nygårds
2016-03-03 0:06 ` Bart Schaefer
2016-03-04 8:17 ` Jesper Nygårds
2016-03-04 13:22 ` Jesper Nygårds
2016-03-04 14:03 ` Peter Stephenson
2016-03-04 14:20 ` Peter Stephenson
2016-03-04 21:49 ` Peter Stephenson
2016-03-05 17:47 ` Bart Schaefer
2016-03-06 18:10 ` Peter Stephenson
2016-03-07 9:59 ` Jesper Nygårds [this message]
2016-03-07 10:15 ` Peter Stephenson
2016-03-05 17:37 ` Bart Schaefer
2016-03-06 17:31 ` Bart Schaefer
2016-03-21 23:05 ` Bart Schaefer
2016-03-02 9:32 ` Peter Stephenson
2016-03-02 23:46 ` Bart Schaefer
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='CABZhJg8R05T7_=3UTETvsvQixt+g60ZvGdc=PpMCSq43-FJdCQ@mail.gmail.com' \
--to=jesper.nygards@gmail.com \
--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).