Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Extended globbing seems to have become much slower in recent versions of Zsh
- X-seq: zsh-users 21336
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Extended globbing seems to have become much slower in recent versions of Zsh
- Date: Tue, 1 Mar 2016 20:11:09 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=/Fn6Ev6uz1b2W/YzWYdwAaei1zOHxvChQeF+JCUVNUc=; b=Pgoen/fLpqO4IHLfzKhdM4ajRZQbJ6aTcLKqQndcXEW2O3FYLNUO7+yFB8d4929Px+ l+Wewl2HAf0K9n1oC54FvA2s/E1+dwQvP/OOTgTOMoeYass037lqcLBRkUo1g7OA3KWZ ysHQ4JmUCFqdX4MQI0o08VViXLnbsnrfO9PGtFmrjsc1sxGP45UInWhtcelcAOqOm+BM KJJAws6WWVr93+3amkMN1rSeKJmKTp1u1iJ2WSVAhP0XKjSoDxy44ulguVOx1z2ge9na AhjvIgQ2xhyFxMGlkBooNOp/ug+VvqZRaAolW3uD/I92x2GQ8uKhDzrqXyJ37BKD0cVG ElHQ==
- In-reply-to: <160301102807.ZM8036@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg--GUe_1zfXxvvX4Dn=t8MgqG2e7poFCSFKKtC3a3AQ7g@mail.gmail.com> <160229111212.ZM4272@torch.brasslantern.com> <CABZhJg84-E=P0-194mwQz4oGkZfwgBnevViBjMUZz7c2PV-a6A@mail.gmail.com> <160301102807.ZM8036@torch.brasslantern.com>
New runs with your suggestion:
% /usr/local/bin/zsh --version
zsh 5.2 (x86_64-apple-darwin14.5.0)
% /usr/local/bin/zsh -f
% setopt EXTENDED_GLOB; float SECONDS MYNOW
% MYNOW=$SECONDS; :
**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D);
print $(( $SECONDS - $MYNOW ))
36.463269999999994
% MYNOW=$SECONDS; :
(#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D);
print $(( $SECONDS - $MYNOW ))
45.178413000000006
% MYNOW=$SECONDS; :
**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*);
print $(( $SECONDS - $MYNOW ))
26.012812999999994
% MYNOW=$SECONDS; :
(#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*);
print $(( $SECONDS - $MYNOW ))
23.646717999999964
-------------------------------------------------------
% /bin/zsh --version
zsh 5.0.5 (x86_64-apple-darwin14.0)
% /bin/zsh -f
% setopt EXTENDED_GLOB; float SECONDS MYNOW
% MYNOW=$SECONDS; :
**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D);
print $(( $SECONDS - $MYNOW ))
13.899865999999989
% MYNOW=$SECONDS; :
(#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D);
print $(( $SECONDS - $MYNOW ))
10.239834999999999
% MYNOW=$SECONDS; :
**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*);
print $(( $SECONDS - $MYNOW ))
5.4469640000000084
% MYNOW=$SECONDS; :
(#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*);
print $(( $SECONDS - $MYNOW ))
6.2737860000000296
On Tue, Mar 1, 2016 at 7:28 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
wrote:
> On Mar 1, 12:39pm, Jesper Nygards wrote:
> }
> } Here's another run with your supplied patterns. I hope I didn't
> } misunderstand how you wanted me to use the SECONDS variable.
>
> Close enough.
>
> } In any case, as you can see below, the globbing more or less takes the
> same
> } time for the simple patterns, but as soon as I introduce the exclusions,
> } the 5.2 version is around six times slower than the 5.0.5 version.
>
> That tends to point to changes in pattern matching rather than globbing
> (related but distinct operations), but can you also try it with
>
> : pattern-goes-here
>
> instead of
>
> myfiles=( pattern-goes-here )
>
> ?? I'd like to factor out the contributions of memory management for the
> array assignment. I ran a couple of quick local tests and with assignment
> there are about 50% more calls to malloc in the current git head than in
> 5.0.5, but without assignment there are slightly fewer in current.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author