From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23995 invoked from network); 14 Apr 1999 08:15:30 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Apr 1999 08:15:30 -0000 Received: (qmail 13889 invoked by alias); 14 Apr 1999 08:15:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6027 Received: (qmail 13882 invoked from network); 14 Apr 1999 08:15:19 -0000 Message-Id: <9904140751.AA26987@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: matching in the new completion system In-Reply-To: "Sven Wischnowsky"'s message of "Wed, 14 Apr 1999 08:19:31 DFT." <199904140619.IAA04978@beta.informatik.hu-berlin.de> Date: Wed, 14 Apr 1999 09:50:59 +0200 From: Peter Stephenson Sven Wischnowsky wrote: > The patch below should make things faster by > avoiding the pattern matching if the string from the line is empty > (for the component currently handled). That seems to remove the problem for all the ordinary things I've tried so far. Thanks. I was thinking about having compadd prepare the final list, i.e. you give it a list of prefixes and maybe suffixes when you use the -O option so that you don't have to do any filtering on the pattern later on. But at the moment it doesn't seem to be necessary. > > It does seem to be due to speed. In fact, it now takes 8 seconds just to > > build all the files in the Src directory, irrespective of path completion, > > which should be almost instantaneous. I smell a rat somewhere. > > Ugh. 8 seconds??? Without xtrace? Yes, and it's now back to what it was. Whenever I stopped it with the debugger, it was evaluating a whole stack (some 100's) of nested parsecompsw()'s, and always stopped in zhalloc() looking for a free heap. All the previous ones seemed to be exactly full, which strikes me as a bit fishy. Even so, maybe it's worth thinking about having a separate free list to reduce the search time --- since the blocks are 8k long, it could be removed from that when there was less than the length of a short string remaining without wasting too much space. I'm not using the zsh memory routines, since they don't work for AIX. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy