[tools] testbot/Engine: Optimize sorting the jobs for scheduling.

Francois Gouget fgouget at codeweavers.com
Wed Apr 6 17:31:09 CDT 2022


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 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 f606c0d07..cc2ea1f18 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
-- 
2.30.2




More information about the wine-devel mailing list