Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: matching in the new completion system



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 <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author