Module: tools Branch: master Commit: ac924787cece99d383ce61101c4718aac87a4977 URL: https://source.winehq.org/git/tools.git/?a=commit;h=ac924787cece99d383ce6110...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Apr 7 00:31:09 2022 +0200
testbot/Engine: Optimize sorting the jobs for scheduling.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/WineTestBot/Engine/Scheduler.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm index f606c0d..cc2ea1f 100644 --- a/testbot/lib/WineTestBot/Engine/Scheduler.pm +++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm @@ -44,8 +44,9 @@ use WineTestBot::VMs; sub CompareJobPriority { # Process Jobs with a higher Priority value last (it's a niceness in fact), - # and older Jobs first. - return $a->Priority <=> $b->Priority || $a->Id <=> $b->Id; + # and older Jobs first. And use GetColValue() for performance. + return $a->GetColValue("Priority") <=> $b->GetColValue("Priority") || + $a->GetColValue("Id") <=> $b->GetColValue("Id"); }
=pod