Speed up data reading. Read it backwards and only as much as needed.

This commit is contained in:
slamm%netscape.com 1999-03-05 01:25:23 +00:00
Родитель 05210ca51d
Коммит 461bd7d97d
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -197,13 +197,15 @@ sub load_buildlog {
}
for $t (@treelist) {
open(BUILDLOG, "<$t->{name}/build.dat" );
while( <BUILDLOG> ){
use Backwards;
my ($bw) = Backwards->new("$t->{name}/build.dat") or die;
while( $_ = $bw->readline ) {
chomp;
($mailtime, $buildtime, $buildname, $errorparser, $buildstatus, $logfile, $binaryname) =
split( /\|/ );
last if $buildtime < $mindate;
$buildrec = {
mailtime => $mailtime,
buildtime => $buildtime,
@ -215,13 +217,11 @@ sub load_buildlog {
td => $t
};
if( $mailtime > 0
&& $buildtime > $mindate
&& ($form{noignore} || !($t->{ignore_builds}->{$buildname} != 0))
){
push @{$build_list}, $buildrec;
}
}
close( BUILDLOG );
}
}