From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20964 invoked by alias); 1 Mar 2016 11:39:49 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21334 Received: (qmail 9434 invoked from network); 1 Mar 2016 11:39:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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=R6TW8d0UlN9C7tun3smoylhlko+SG3qn1lWzYcHX1/Q=; b=TgzdS1JfLqYaTOwftER3v0xiCna6fQu0OGd9ZEO7rYm0gON4vgFQzwZsOxOFWe4i2u Z5Bs3m4uHf35NQIleSL39fkZj1CYo2kHp6LaVavIUHHFc48Khu+v6QC1ZsBA4Jg0ty5+ Bia2DixPsxszaLZYSOmSzst4qn3KuRKMrsUH18n1vUAD3C5/3Whu1QysrJt/W0WR23oj JSEhkfuMK94WHQuMHwae5PEcc5IHUHkHBoMaAwOZ6nZHfSxwbJj1XBlIk6WSaeevqEvG NQjZ7DSNyy8ZMv9VIF0e52QI0wLG5ocS0CdhDDE5aypIBR/Z8kzS0t0pRtvzxBG1XFnq zlkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=R6TW8d0UlN9C7tun3smoylhlko+SG3qn1lWzYcHX1/Q=; b=JsN86dmkooONBpkLdUcppyKSEvBy4pSaXha0WnnyjYulxzWF2E3m72BK5cU5iEmR6n PBAX1wfT1qVgguO67QtO6ePZdXsr61j7mghTSrAiJRW5AZ6WlmrIk+d7BrhtJbQTIKwE BrkeWEc3G2qI7RK05ij1Z5YhWQjvPvY0O20GSkiQBUMG7wNJNv5bxd1NifVGyBvvPDV4 V//VOwvVpAP+MNFb1J+WGkwykgzAbKoWdOlUGltLHsWa7qadZJwnw0wI/GqIODLeUpuD Q7Imu68SRsOV1on8Z8oAs4jNVDPrTy7Ir9ITJbHP+RA118sHW8cQA63S20h772gEsD6R NsUA== X-Gm-Message-State: AD7BkJJNb9fira4jEXlYub0ZFQJFD9/oOH6QEOfiXH3F+/tvwP9xbTKAWJ460gWORrruogzaV2L+pR3qQfqb2Q== MIME-Version: 1.0 X-Received: by 10.25.127.208 with SMTP id a199mr5919540lfd.149.1456832383485; Tue, 01 Mar 2016 03:39:43 -0800 (PST) In-Reply-To: <160229111212.ZM4272@torch.brasslantern.com> References: <160229111212.ZM4272@torch.brasslantern.com> Date: Tue, 1 Mar 2016 12:39:43 +0100 Message-ID: Subject: Re: Extended globbing seems to have become much slower in recent versions of Zsh From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= To: Zsh Users Content-Type: multipart/alternative; boundary=001a113eb6dab713e5052cfb3880 --001a113eb6dab713e5052cfb3880 Content-Type: text/plain; charset=UTF-8 Here's another run with your supplied patterns. I hope I didn't misunderstand how you wanted me to use the SECONDS variable. 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. % du -sh . 2.4G . % print -l **/*(D) | wc -l 272681 ------------------------------------------------------ % /usr/local/bin/zsh --version zsh 5.2 (x86_64-apple-darwin14.5.0) % /usr/local/bin/zsh -f % pwd /opt/intyg % setopt EXTENDED_GLOB % float SECONDS MYNOW % MYNOW=$SECONDS; myfiles=(**/*); print $(( $SECONDS - $MYNOW )) 20.477513999999996 % MYNOW=$SECONDS; myfiles=(**/*(-.D)); print $(( $SECONDS - $MYNOW )) 20.415430000000001 % MYNOW=$SECONDS; myfiles=(**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D)); print $(( $SECONDS - $MYNOW )) 36.53519 % MYNOW=$SECONDS; myfiles=((#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D)); print $(( $SECONDS - $MYNOW )) 38.467647999999997 % MYNOW=$SECONDS; myfiles=(**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)); print $(( $SECONDS - $MYNOW )) 23.871832999999981 MYNOW=$SECONDS; myfiles=((#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)); print $(( $SECONDS - $MYNOW )) 23.234887999999955 ------------------------------------------------------- % /bin/zsh --version zsh 5.0.5 (x86_64-apple-darwin14.0) % /bin/zsh -f % pwd /opt/intyg % setopt EXTENDED_GLOB % float SECONDS MYNOW % MYNOW=$SECONDS; myfiles=(**/*); print $(( $SECONDS - $MYNOW )) 15.603122999999997 % MYNOW=$SECONDS; myfiles=(**/*(-.D)); print $(( $SECONDS - $MYNOW )) 17.826644999999999 % MYNOW=$SECONDS; myfiles=(**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D)); print $(( $SECONDS - $MYNOW )) 6.5746579999999994 % MYNOW=$SECONDS; myfiles=((#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D)); print $(( $SECONDS - $MYNOW )) 6.1519139999999766 % MYNOW=$SECONDS; myfiles=(**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)); print $(( $SECONDS - $MYNOW )) 3.6434740000000261 % MYNOW=$SECONDS; myfiles=((#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)); print $(( $SECONDS - $MYNOW )) 4.0673059999999737 On Mon, Feb 29, 2016 at 8:12 PM, Bart Schaefer wrote: > On Feb 28, 9:18pm, Jesper Nygards wrote: > } > } The results of my experiments seem to indicate that something has changed > } relatively recently with regards to extended globbing. > > There were a number of changes mostly related to correct handling of > multibyte characters and single bytes in the range 128-255 appearing > in file and directory names. This means some strings are passing > through the "unmetafication" process more often than they were, but > I can't say for sure this is the source of any slowdown. > > It'd be helpful if you re-ran your tests with more variations of the > pattern: > > **/* > **/*(-.D) > **/*~(your long list of exclusions) > (#i)**/*~(your long list of exclusions) > **/*~(your long list of exclusions)(-.D) > > Also, first declare "float SECONDS" and then use "print $SECONDS" instead > of "date", so we get a more precise measure of where the time is spent. > --001a113eb6dab713e5052cfb3880--