Lightz-AIO | Implement rules splitting based on alignment stats
Objective
Implement an intelligent rule-splitting mechanism based on execution times calculated during the alignment scan. This aims to optimize multi-core scanning for balanced execution time.
Background
This issue is part of the larger effort to "Optimize multi-core scanning for balanced execution time" in GLAS.
Proposed Solution: Distribution Algorithm
We will implement a greedy distribution algorithm with the following steps:
-
Cache Loading:
- Load the execution time cache at startup.
- This cache should contain rule execution times from previous alignment scans.
-
Rule Sorting:
- Sort rules by their execution time, from longest to shortest.
-
Greedy Distribution:
- Start with the longest-running rules.
- Assign each rule to the core with the lowest total assigned time.
- This approach aims to balance the workload across all available cores.
-
Fallback Mechanism:
- If no cache is available, fall back to the current method of rule distribution.
Verification
Edited by Hua Yan