The check to see whether a build had been scheduled in a previous evaluation took about 200 ms for the nixpkgs:trunk jobset. Given that it has more than 15000 builds, this added up to a lot. Now it takes 0.2 ms per build.
QS4OX6Z7OC46ZBRSEGQQAVKIMXRHDDRXS32EJI6DGN37AXH23K3QC
my ($prevBuild) = $prevEval->builds->search({ job => $job->name, outPath => $outPath }, { rows => 1, columns => ['id'] });
my ($prevBuild) = $prevEval->builds->search(
# The "project" and "jobset" constraints are
# semantically unnecessary (because they're implied by
# the eval), but they give a factor 1000 speedup on
# the Nixpkgs jobset with PostgreSQL.
{ project => $project->name, jobset => $jobset->name, job => $job->name, outPath => $outPath },
{ rows => 1, columns => ['id'] });