Update of /cvsroot/lxr/lxr/lib/LXR
In directory usw-pr-cvs1:/tmp/cvs-serv18411
Modified Files:
Common.pm
Log Message:
Fix bug with configurable tabwidth and files that have no language associated
with them.
Remove the stat-ing of all the included modules when generating a Last-Modified
header. This should speed up HTML generation since there are a lot of modules
and they change very rarely.
Index: Common.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Common.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- Common.pm 2001/11/14 15:03:29 1.35
+++ Common.pm 2001/11/17 03:06:19 1.36
@@ -293,11 +293,11 @@
my @itag = &idref(1, "fid", 1) =~ /^(.*=)1(\">)1(<\/a>)$/;
my $lang = new LXR::Lang($pathname, $release, @itag);
- my $language = $lang->language; # To get back to the key to lookup the tabwidth.
# A source code file
if ($lang) {
- &LXR::SimpleParse::init($fileh, $config->filetype->{$language}[3], $lang->parsespec);
+ my $language = $lang->language; # To get back to the key to lookup the tabwidth.
+ &LXR::SimpleParse::init($fileh, $config->filetype->{$language}[3], $lang->parsespec);
my ($btype, $frag) = &LXR::SimpleParse::nextfrag;
@@ -426,19 +426,23 @@
my $time2 = (stat($config->confpath))[9];
$time = $time2 if $time2 > $time;
- my %mods = ('main' => $0, %INC);
- my ($mod, $path);
- while (($mod, $path) = each %mods) {
- $mod =~ s/.pm$//;
- $mod =~ s|/|::|g;
- $path =~ s|/+|/|g;
+ # Remove this to see if we get a speed increase by not stating all
+ # the modules. Since for most sites the modules change rarely,
+ # this is a big hit for each access.
+
+# my %mods = ('main' => $0, %INC);
+# my ($mod, $path);
+# while (($mod, $path) = each %mods) {
+# $mod =~ s/.pm$//;
+# $mod =~ s|/|::|g;
+# $path =~ s|/+|/|g;
- no strict 'refs';
- next unless $ {$mod.'::CVSID'};
+# no strict 'refs';
+# next unless $ {$mod.'::CVSID'};
- $time2 = (stat($path))[9];
- $time = $time2 if $time2 > $time;
- }
+# $time2 = (stat($path))[9];
+# $time = $time2 if $time2 > $time;
+# }
if ($time > 0) {
my ($sec, $min, $hour, $mday, $mon, $year,$wday) = gmtime($time);
|