Francois Gouget : testbot/Engine: Optimize sorting the jobs for scheduling.

Alexandre Julliard julliard at winehq.org
Thu Apr 7 16:07:10 CDT 2022


Module: tools
Branch: master
Commit: ac924787cece99d383ce61101c4718aac87a4977
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=ac924787cece99d383ce61101c4718aac87a4977

Author: Francois Gouget <fgouget at 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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




More information about the wine-cvs mailing list