From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12143 invoked from network); 8 Jun 2000 08:53:35 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jun 2000 08:53:35 -0000 Received: (qmail 13885 invoked by alias); 8 Jun 2000 08:53:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11816 Received: (qmail 13878 invoked from network); 8 Jun 2000 08:53:25 -0000 Date: Thu, 8 Jun 2000 10:53:13 +0200 (MET DST) Message-Id: <200006080853.KAA18466@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Wed, 7 Jun 2000 17:14:03 +0000 Subject: Re: Speaking of slow completion ... Bart Schaefer wrote: > Have any of you with sourceforge logins tried completing `cd /h/g/z'? > > It's *minutes* before something comes back, the first time. Thereafter > the filesystem info is cached (by the linux kernel, not in zsh) and it > goes down to only several seconds. (E.g. if you were to log in and try it > *right now*, it'd be fairly fast, because *I* just waited the minutes for > the FS cache to load.) > > Any ideas on optimizing _path_files for directories with LOTS of subdirs? I have been thinking about _path_files quite often. For one thing I still think if any completion function gets C-code support, than it should be _path_files, probably the function that gets called more often than every other function. C-support should help us avoid all that array-handling. Another thing is the globbing. Because of possible `*' match specs, _path_files has to always get all files (or directories), which is slowish, of course. Even using the first character of the $PREFIX in the globbing could speed things up significantly, but if that is one of the anchors in a `r:|...=*' pattern, the result could be wrong. Hm, maybe we should add C-support for getting `special' characters with respect to the currently used match specs and _path_files could then use the part of the $PREFIX (and $SUFFIX) that doesn't contain such characters. Another (more interesting) thing is trying to glob more than one directory level at once. There's a problem with the expand styel, though. Felix Rosencrantz wrote: > Something I suggested in workers/9630 would be to have a style that caused > _path_files to basically do stats (-d/-f) on the leading portion of a path that > is to be completed. If the leading part exists, don't attempt to do any > completion on that part of the path, you've got what you want. Or check for > existence before attempting to glob a name. Seem like I didn't fully grok that at that time. Yes, indeed, doesn't even sound hard to implement. > ... > > Also, on a side note, I think there might be a bug in compadd (possibly > matching) that causes it to get in a bad state if an interrupt is sent while it > is working. I typically want to interrupt in situations when completion is > slow. Completion works, but matching seems to have some problems. (I know, > you probably want some those helpful details...) Indeed, I do. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de