From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18019 invoked by alias); 1 Mar 2016 19:11:15 -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: 21336 Received: (qmail 18156 invoked from network); 1 Mar 2016 19:11:14 -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=/Fn6Ev6uz1b2W/YzWYdwAaei1zOHxvChQeF+JCUVNUc=; b=Pgoen/fLpqO4IHLfzKhdM4ajRZQbJ6aTcLKqQndcXEW2O3FYLNUO7+yFB8d4929Px+ l+Wewl2HAf0K9n1oC54FvA2s/E1+dwQvP/OOTgTOMoeYass037lqcLBRkUo1g7OA3KWZ ysHQ4JmUCFqdX4MQI0o08VViXLnbsnrfO9PGtFmrjsc1sxGP45UInWhtcelcAOqOm+BM KJJAws6WWVr93+3amkMN1rSeKJmKTp1u1iJ2WSVAhP0XKjSoDxy44ulguVOx1z2ge9na AhjvIgQ2xhyFxMGlkBooNOp/ug+VvqZRaAolW3uD/I92x2GQ8uKhDzrqXyJ37BKD0cVG ElHQ== 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=/Fn6Ev6uz1b2W/YzWYdwAaei1zOHxvChQeF+JCUVNUc=; b=FkDO/3LghIttDw6nW0KXgQZtc4Piy6Q1lRtK2TrbJhydctVrWM87l02yNo1fQ/pUiq R+sVJMWsV2wvypH4HryWT1KBeDCJXBYmZf7CDadBxCXdm6TfNHDITJoK+yrN+ZzXOvdR 918oyN/gjKU3lGN7L/a/4U+YQ7VGkqPJcgKG5xrePEXwZNfaHpfTYiuvq2F1vvlMv9Lv x/3kTF4ZJSunloTYHTP2lm5RjwXYc6yah/9v26jmpm7mQqvSpY3aMYmQHnS3kmqgbo+q 1BN5YmS0RDAmc8ckzM/Pni6QEtJm2ATaw24TERMWhN7sY1xN0/YA5IldCt81lgKIHD+z ch2Q== X-Gm-Message-State: AD7BkJLcMimc1uMV4l1SSR++DVVR4parxAukZAy4pkRAAMnpohV4A5NSRCF0qDZfJJv0ibeQ94TiZ2xwCF+8hA== MIME-Version: 1.0 X-Received: by 10.112.63.231 with SMTP id j7mr8792338lbs.52.1456859469202; Tue, 01 Mar 2016 11:11:09 -0800 (PST) In-Reply-To: <160301102807.ZM8036@torch.brasslantern.com> References: <160229111212.ZM4272@torch.brasslantern.com> <160301102807.ZM8036@torch.brasslantern.com> Date: Tue, 1 Mar 2016 20:11:09 +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=001a1133d07e265615052d01870a --001a1133d07e265615052d01870a Content-Type: text/plain; charset=UTF-8 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 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. > --001a1133d07e265615052d01870a--