From: Joseph N. Hall Date: Fri, 5 Sep 1997 00:00:00 +0000 (+0000) Subject: perldoc diffs: don't search auto - much faster X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=62b753c6ae4ab9bf22fbb6ec7ceac820bcef8fe4;p=p5sagit%2Fp5-mst-13.2.git perldoc diffs: don't search auto - much faster Give this a try. It causes unsuccessful searches to run about 3 times as fast on my machine. Not exactly a speed demon but at least you don't have time to get up and make coffee. I tried adding caching to stop the repeated readdir in the case-insensitive matching subroutine, but a) it only lopped off another 20% and b) the patch made a kind of a Frankenstein thing out of the subroutine, so c) I will try to write a better one later when I have time. p5p-msgid: MailDrop1.2d7dPPC.971012211957@screechy.cscaper.com --- diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 0f43c36..0bb4542 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -195,7 +195,11 @@ sub minus_f_nocase { if($recurse) { opendir(D,$dir); - my(@newdirs) = grep(-d,map("$dir/$_",grep(!/^\.\.?$/,readdir(D)))); + my @newdirs = map "$dir/$_", grep { + not /^\.\.?$/ and + not /^auto$/ and # save time! don't search auto dirs + -d "$dir/$_" + } readdir D; closedir(D); @newdirs = map((s/.dir$//,$_)[1],@newdirs) if $Is_VMS; next unless @newdirs;