From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6032 invoked by alias); 2 Mar 2016 08:39:12 -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: 21338 Received: (qmail 14133 invoked from network); 2 Mar 2016 08:39:10 -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=RBXkAUliiK7owilSHZh4/GyMXVdHx5EzEGNWxRvgg+c=; b=0Xe92zgtCKnZipXj9CNvT0kxwZT8j353r51be5lcz0ndPevOu9EGS8nZeAdghNCwov /WhYv8HglZY/fFwAMIC3pjcxs5tZLzh6zM67mxQssX5XcqGAYFdtwAnENl7wQroXtBXR VBw12TGkhdoLWaGnC2KGpsJ+zahntBE8LjD119FNxxBpVIOybfTAn+IhPEgg+4o2aCoS NjwGXUYTIzKWVrr7UDOY2+b7yW54+DrDt4kdWXUjgejio3oCgUe7m6jhS4VNfGLqoWS1 67HgSGqI7xtzOFtKfFe6osCNU4mTcG0LN368ymNcEY86RxgMW53PValSxHmRO57HU0HL NwrA== 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=RBXkAUliiK7owilSHZh4/GyMXVdHx5EzEGNWxRvgg+c=; b=K7QwGp2/G8/MbR9VSuTOTlD+gYsZJ2x0cn6n8ir5Fg70Ek+aVkvDQN1Pe+/lMApJAj jaZrN0alSNkCuURkdlAFVwAMkI3vOJAC/xz88uga1M80eHdI38GXK2QrECSIMz9mlVSg Rv4s+VoaA8CoceXmdOx/NKL3LSSOLOUFvr6tGKpCOXhzcF0w8d8ve4diTUHWBeziOuSB wEZL1KjPDn6UyPX3Vmxz7pzo4Ipfoo/f7KObcaTjQSv4Khog9gmfpiRwJCojeZ8cgl/3 72BN5PRYO2J3WYUitoPzR4DH/yiaQGqJ9XC5W/afUl5nrDceKDwV267tpVh9b65ItVYb nj6Q== X-Gm-Message-State: AD7BkJL7/vJrCd1GcnRKB03mZAMGDrnUs1Jc3Z9XDtXkBdRl4/GcvXAyU9sLzZj1FmiDDu16W1TwOUdqci4xQg== MIME-Version: 1.0 X-Received: by 10.112.63.231 with SMTP id j7mr9921930lbs.52.1456907945405; Wed, 02 Mar 2016 00:39:05 -0800 (PST) In-Reply-To: <160301160356.ZM10258@torch.brasslantern.com> References: <160229111212.ZM4272@torch.brasslantern.com> <160301102807.ZM8036@torch.brasslantern.com> <160301160356.ZM10258@torch.brasslantern.com> Date: Wed, 2 Mar 2016 09:39:05 +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=001a1133d07e8e7421052d0cd0b7 --001a1133d07e8e7421052d0cd0b7 Content-Type: text/plain; charset=UTF-8 Previously I was using the Apple-provided version of 5.0.5, and the Homebrew version of 5.2. Now I have instead used different versions of Homebrew zsh, and I have made sure that the compiler flags were the same through all versions. I have then run the same tests again, with versions 5.0.5, 5.0.6, 5.1 and 5.2. % /usr/local/bin/zsh --version zsh 5.0.5 (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 )) 21.925625999999998 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D); print $(( $SECONDS - $MYNOW )) 15.809167000000002 % MYNOW=$SECONDS; : **/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 9.8283599999999893 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 4.0556160000000006 ------------------------------------------------------- % /usr/local/bin/zsh --version zsh 5.0.6 (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 )) 51.819927999999997 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D); print $(( $SECONDS - $MYNOW )) 54.338758999999996 % MYNOW=$SECONDS; : **/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 35.885299000000003 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 29.573196999999993 ------------------------------------------------------- % /usr/local/bin/zsh --version zsh 5.1 (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 )) 55.068858999999989 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D); print $(( $SECONDS - $MYNOW )) 55.551114999999982 % MYNOW=$SECONDS; : **/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 31.761401000000035 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 33.984271000000035 ------------------------------------------------------- % /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 )) 46.693610000000007 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*)(-.D); print $(( $SECONDS - $MYNOW )) 48.288181999999992 % MYNOW=$SECONDS; : **/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 31.169990000000013 % MYNOW=$SECONDS; : (#i)**/*~(|*/)(build|target|node|node_modules|.idea|*.min.js|*.iml|TAGS)(|/*); print $(( $SECONDS - $MYNOW )) 25.161075000000011 On Wed, Mar 2, 2016 at 1:03 AM, Bart Schaefer wrote: > On Mar 1, 8:11pm, Jesper Nygards wrote: > } > } New runs with your suggestion: > > Well, that's interesting. Seems to indicate that building argv to pass > to builtins is even more expensive than an array assignment. > > Still, I can't find anything on my system that causes as dramatic a > difference as yours from 5.0.5 -> 5.2+. The (-.D) qualifiers seem to > have the largest effect for me, for you its the exclusion pattern. > > For the sake of covering all bases, are you sure the same compiler > optimization flags were applied to the 5.0.5 and 5.2 builds you are > testing? With your exclusion pattern and about 13,000 files in **/*, > there are about 100,000 calls to strlen() in either version, so any > optimization of that might make a large difference. > > I did find a small but observable speedup when compiling without > MULTIBYTE_SUPPORT, too; there were a lot of multibyte repairs to > pattern.c after 5.0.5. > --001a1133d07e8e7421052d0cd0b7--