From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29808 invoked from network); 31 Aug 1999 17:14:53 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Aug 1999 17:14:53 -0000 Received: (qmail 27338 invoked by alias); 31 Aug 1999 17:14:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7583 Received: (qmail 27331 invoked from network); 31 Aug 1999 17:14:41 -0000 From: "Bart Schaefer" Message-Id: <990831171058.ZM16997@candle.brasslantern.com> Date: Tue, 31 Aug 1999 17:10:58 +0000 In-Reply-To: <199908310822.KAA27325@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: 6-pws-2" (Aug 31, 10:22am) References: <199908310822.KAA27325@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: 6-pws-2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 31, 10:22am, Sven Wischnowsky wrote: } Subject: Re: 6-pws-2 } } 2) probably add caches for parsed patterns (e.g. give patcompile() an } optional pointer to a patcache struct which would contain the } strings and compiled pattern of the last few patterns used at the } call site and make patcompile() first look there) The cache lookup would have to be awfully fast to make it worthwhile. I think we'd get a lot more benefit from this: } 3) store compiled patterns in the execution tree (for now I'm only } thinking about `case', `[[ .. = .. ]]' and `[[ .. != .. ]]' if the } patterns don't need to be singsub()ed, which could be checked at } parse time) ... but even there it'll mostly help loops, not one-pass sorts of things like sourcing init files. The ideal thing might be to "incrementally" compile the pattern; do just enough to start discarding strings that can't possibly match, then do a bit more upon finding one that might, etc., so parsing and compiling the full pattern requires encountering the first successful match (unless it's a really intractible pattern). Master's theses have been written on less interesting problems ... you aren't looking to get a paper out of this, are you, Peter? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com