Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Magnus Holmgren" To: Subject: RE: Tab completion list takes enormously long time to generate from empty string Date: Sun, 19 Jan 2003 14:02:37 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 In-Reply-To: <5.2.0.9.2.20030113161921.028eed10@pop3.cris.com> X-Spam-Status: No, hits=-5.2 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,SATISFACTION,SPAM_PHRASE_01_02, SUBJECT_IS_LIST,SUPERLONG_LINE version=2.41-liu_1.3 X-Spam-Level: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h0JD35D25065 > > Mangus, > > At 16:12 2003-01-13, Magnus Holmgren wrote: > > > -----Original Message----- > > > From: Magnus Holmgren [mailto:magho AT home DOT se] > > > Sent: Monday, January 13, 2003 7:51 PM > > > To: cygwin AT cygwin DOT com > > > Subject: Tab completion list takes enormously long time to generate > > from empty string > > > > > > > > > Greetings. > > > > > > When I press tab in bash without having typed anything at all > > > (which is somewhat abusive but it easily happens), bash works for > > > 15 minutes, going through $PATH looking for executables (and in > > > the end producing nothing) on a 2x450 MHz PIII. Is that normal? > > The time consumed in this sort of thing is almost certainly dominated by > I/O activity, not CPU load. > Well, there are certainly some disk I/O, but also 100% load on one processor, so the operation seems to be CPU-bound anyway. > How long does it take Cygwin Setup to compute the list of > packages that are > candidates for download or installation? If your 15 minute time > to produce > a list of executables for command completion is any indication, > it must be > hours! > A few seconds. Bite that! :) But Cygwin setup doesn't have to open and read thousands of files. And it's not using cygwin1.dll. The Cygwin layer seems to slow down things considerably. > On my 2.4 GHz single processor system with fast disks, it takes > only a few > seconds to get the beep on the first tab and only about a second > or two to > be asked if I want to see all 3719 possibilities on the second tab. > I was able to strip down my $PATH a bit (removing KDE for example), reducing the time needed to generate the list to some minute, but I'm not quite satisfied with that either. > It's too bad so many DLLs are produced in this list. Must they > have execute > bits set to be loaded? > NT does have separate read and execute bits. I don't know if DLL:s have to have the execute bits set to be loaded, but it's rather laborious to change all the permissions anyway. Windows primarily relies on extensions to determine what files are executable, as you know. Perhaps cygwin should do that as well, i.e. only check files with known extensions for #!/path? > > > > >Correction; there is no writing to disk, but certainly loads of > *reading*, > >and quicksort seems to be used, so I don't blame the sorting anymore. > > > >I reckon that all files in $PATH (except .exe-s) have to be > opened to see > >if they start with #!, and that that takes some time. Getting > rid of some > >entries in $PATH surely reduces the time consumed, but I still > think that > >more than five seconds is too much. > > Any perceptible delay in getting a result from a computer is too long. So > it goes... > Hey! I didn't say that! I'll be fine with ten seconds! :-) > > >Some optimizations should be possible, such as only checking files with > >certain extensions, like .sh, .pl, and none at all for the magic "#!" or > >caching the list in some form. A second option might even be to disallow > >tab completion of commands without entering a prefix. > > This is the sort of thing the "-x," "-E" and "-X" options to "mount" are > meant to address. Check them out, they can probably help a lot with this > problem. It helps a bit, or even a lot, but at the price that all files will be tab completed to. Unless I create a mount point to each directory in $PATH. /Magnus > > Randall Schulz > > > >/Magnus > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/