Reduce I/O in build listings by only fetching required columns
Columns such as "longDescription" can be large, so fetching them when they're not needed is wasteful.
This commit is contained in:
@ -65,6 +65,7 @@ sub all : Chained('get_builds') PathPart {
|
||||
$c->stash->{builds} = [ $c->stash->{allBuilds}->search(
|
||||
{ finished => 1 },
|
||||
{ order_by => "timestamp DESC"
|
||||
, columns => [@buildListColumns]
|
||||
, rows => $resultsPerPage
|
||||
, page => $page }) ];
|
||||
}
|
||||
|
@ -51,16 +51,15 @@ sub nixexprs : Chained('nix') PathPart('nixexprs.tar.bz2') Args(0) {
|
||||
|
||||
sub name {
|
||||
my ($build) = @_;
|
||||
return $build->get_column('releasename') || $build->nixname;
|
||||
return $build->releasename || $build->nixname;
|
||||
}
|
||||
|
||||
|
||||
sub sortPkgs {
|
||||
# Sort by name, then timestamp.
|
||||
# Sort by name, then id.
|
||||
return sort
|
||||
{ lc(name($a->{build})) cmp lc(name($b->{build}))
|
||||
or $a->{build}->timestamp <=> $b->{build}->timestamp
|
||||
} @_;
|
||||
or $a->{build}->id <=> $b->{build}->id } @_;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user