From 26858cdf3dbbbdc4bddf55de0e769433b7a0016e Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 22 Feb 2019 00:56:04 +0000 Subject: [PATCH] Link graph: Clamp job duration multipliers to 1 for small jobs Cost estimate < 4000 --- src/linkgraph/linkgraphschedule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp index 371eb62dab..806e31c58a 100644 --- a/src/linkgraph/linkgraphschedule.cpp +++ b/src/linkgraph/linkgraphschedule.cpp @@ -73,7 +73,7 @@ void LinkGraphSchedule::SpawnNext() uint64 cost = lg->CalculateCostEstimate(); used_budget += cost; if (LinkGraphJob::CanAllocateItem()) { - uint duration_multiplier = CeilDivT(scaling * cost, total_cost); + uint duration_multiplier = cost < 4000 ? 1 : CeilDivT(scaling * cost, total_cost); std::unique_ptr job(new LinkGraphJob(*lg, duration_multiplier)); jobs_to_execute.emplace_back(job.get(), cost); if (this->running.empty() || job->JoinDateTicks() >= this->running.back()->JoinDateTicks()) {