From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 5A7F725C9B for ; Mon, 22 Jan 2024 16:08:35 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1705936115; b=Llv/rMoI03DqdW5B2Hqp9LzcLfE+KR+rmGGBDHyDAaA/V8slZyiYQjIIs5/FkVMAseuFUGNRq0 Lx5NLnFHJyEYSZGldlxQobW2VMqxtzGiMMMnQ+yVPrPBIrr13Mx/dcYeWRr0gMg048bLIhTVOC WG53rhqR+p7OXX/Ttf850BJZyW0nXxx98E74vv5sRQI6qlSuPPGrtY/XRDn18UT32j1E9mKZnC qySzyrVJCI4cGVeNYcUtOiZISoMnBWJBiVVuQ+9ikAYsffOlVkzvDd3pB2s58tlCe3YEYKJUAS ADTbDw0LX11aSB+MR7f9U+42vDJSA4yioPV541Spj+D3LQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1705936115; bh=NbifrEfh8/VN/QDT9Ynp0iLltKfcYYK3LIqe3mWu6KY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=PBPyQ0GfW3JhjPUjhc5M1xNivgAHkL2AFS4lU97Z+mx6A9/0AkALOmYJIWDcTRHJs9OitPVQBD Vow+pxidv8rjWdxpkPGUBuAQfqgvHImX60v4OCx8OaoN+leTPwgZ4TbPxyUEhzQmmvqbf/JDIk z5/Psl7xVuyH8F1v45CbHfMnQaliFa3NkBIhYjIkF+i0xcAWAiG45RtyswWjFj/qkqA4C7KvU5 Wr5d+2+FWgMhuJ5xXwAv5cB2xpPWCE03uJJFmChpWXdIMUi61uYd45S9r9TK/f7JCGVVxggq7H 1Mbs6o5W/PqKg2c3w9m/1MuN4IrRahUiN/rd8n+OxGb07w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-reply-to:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=3kSnfPC4lV2oBCHXKrwSXbvTe7diwzdZtSu6ay9CNxg=; b=Tn42k4Q5iY8CpuwI78PiS0KOwQ aYPaPQCV0GZIeqKdeKvMnRluy159Lzz47YgKLJlkYOG72kJlcFZHfdEjK5glW1NrseTumxInJ4mjX l9VClu93eZ7r2cr5GQFe0Hh+wB+N4tAElEBdxO2aKDkPl8dsVwnyAd+aXqEecmSBViAekxmTHl9+W 6VcGGIpQMmAfG/JR6nUVeM+Nxb+6fQ2II718wAkWU7zKPUSk9IsGlr9YP521Cyrs9pSORlGncAn9y vwc8m3nq9xJgBzDH02qJqTuwdD0mjUUnnJl1YKFTRJYja9v7STmAiGLUmLpYGzzlqa/tJ778wVYFg Cx6SfU0g==; Received: by zero.zsh.org with local id 1rRvub-00056y-PM; Mon, 22 Jan 2024 15:08:33 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:41235) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rRvsC-0004PI-5v; Mon, 22 Jan 2024 15:06:04 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca ([24.224.136.10]) with ESMTPS id <0S7O232KE4K8HL00@mta04.eastlink.ca> for zsh-users@zsh.org; Mon, 22 Jan 2024 11:06:03 -0400 (AST) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id RvsAr2taQtqGERvsArJazg (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Mon, 22 Jan 2024 11:06:02 -0400 X-Authority-Analysis: v=2.4 cv=Zvoraf3G c=1 sm=1 tr=0 ts=65ae845a a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=eZB7uxNAF1eYQ5D43cUA:9 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=yrB05RpkbvOPl_fdLHwA:9 a=PM5OQxZi-f1WT01f:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekiedgjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------hKSqBjg2qqS0j0cSmOKstqwx" Message-id: <1c34bc04-1ce3-45f0-ba8e-0c194b7f0102@eastlink.ca> Date: Mon, 22 Jan 2024 07:06:01 -0800 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: /proc slows % echo /**/*/etc/r*(/N) Content-language: en-US To: zsh-users@zsh.org References: <62da1cec-bcc9-49ed-8f5f-ad428fdd3f20@eastlink.ca> From: Ray Andrews In-reply-to: X-Seq: 29543 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: This is a multi-part message in MIME format. --------------hKSqBjg2qqS0j0cSmOKstqwx Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-01-21 22:00, Mikael Magnusson wrote: > You actually can, **/ is shorthand for (*/)# although the latter only > works with extended_glob enabled, the shorthand always works. You can > use any pattern in place of the * if you want (for example, > (^(a|b|c)/)# which would exclude a, b or c from any segment being > recursed), although in the case above I think you'd have actually > wanted /^(proc|sys)/**/etc/r* if the problem was not another typo. > % print -l /^(proc|sys)/**/etc/rc*(/N) ... nothing % print -l /^(proc|sys)/**/etc/rc* /aWorking/Changed/etc/rc.local ... but that's a file not a directory. Now this is interesting.  Doing your verbatim shorthand swap with '(/N)' added: 0 /etc 0 % print -l /(*/)#etc/rc*(/N) /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d /etc/rcS.d ... but that took 37 seconds!  Trying the 'normal' way: 0 /etc 0 % print -l /**/etc/rc*(/N) /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d /etc/rcS.d .... that took 3 seconds!  Not exactly six of one half a dozen of the other, tho the output is correct. Going back to 'your way' but swapping out the asterisk as you say: 0 /etc 0 % print -l /(^(proc|sys)/)#etc/rc*(/N) /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d /etc/rcS.d ... 7 seconds!  Don't know what to make of it.  It seems very happy not to have to search in proc and sys  OTOH it's still twice as long as the 'regular' syntax.  Leaves me scratchin' my head. Since I no longer have to worry about the /proc disaster, as Bart rescued me, the only issue now would be performance, and if skipping proc and sys would help with that, fine, but as we see it seems to backfire.  Matter of curiosity only!  Nothing broken, still one might wonder at these changes in performance.  I tend to think of syntax variations as all ending up as the same thing under the hood, but maybe not.  As to proc and sys, my guess would have been that skipping them would make very little difference since they aren't real directories anyway, and yet it makes 5X difference.  Another loop of some sort?  Sorta like my /proc disaster but perhaps resolving itself somehow? --------------hKSqBjg2qqS0j0cSmOKstqwx Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2024-01-21 22:00, Mikael Magnusson wrote:
You actually can, **/ is shorthand for (*/)# although the latter only
works with extended_glob enabled, the shorthand always works. You can
use any pattern in place of the * if you want (for example,
(^(a|b|c)/)# which would exclude a, b or c from any segment being
recursed), although in the case above I think you'd have actually
wanted /^(proc|sys)/**/etc/r* if the problem was not another typo.

% print -l /^(proc|sys)/**/etc/rc*(/N)

... nothing

% print -l /^(proc|sys)/**/etc/rc*    
/aWorking/Changed/etc/rc.local   

... but that's a file not a directory.

Now this is interesting.  Doing your verbatim shorthand swap with '(/N)' added:

0 /etc 0 % print -l /(*/)#etc/rc*(/N)
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d

... but that took 37 seconds!  Trying the 'normal' way:

0 /etc 0 % print -l /**/etc/rc*(/N)  
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d

.... that took 3 seconds!  Not exactly six of one half a dozen of the other, tho the output is correct.

Going back to 'your way' but swapping out the asterisk as you say:


0 /etc 0 % print -l /(^(proc|sys)/)#etc/rc*(/N)
/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d
/etc/rcS.d

... 7 seconds!  Don't know what to make of it.  It seems very happy not to have to search in proc and sys  OTOH it's still twice as long as the 'regular' syntax.  Leaves me scratchin' my head.  Since I no longer have to worry about the /proc disaster, as Bart rescued me, the only issue now would be performance, and if skipping proc and sys would help with that, fine, but as we see it seems to backfire.  Matter of curiosity only!  Nothing broken, still one might wonder at these changes in performance.  I tend to think of syntax variations as all ending up as the same thing under the hood, but maybe not.  As to proc and sys, my guess would have been that skipping them would make very little difference since they aren't real directories anyway, and yet it makes 5X difference.  Another loop of some sort?  Sorta like my /proc disaster but perhaps resolving itself somehow?





--------------hKSqBjg2qqS0j0cSmOKstqwx--