Skip to content

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:

  1. Cache Loading:
    • Load the execution time cache at startup.
    • This cache should contain rule execution times from previous alignment scans.
  2. Rule Sorting:
    • Sort rules by their execution time, from longest to shortest.
  3. 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.
  4. Fallback Mechanism:
    • If no cache is available, fall back to the current method of rule distribution.

Verification

  • The MR related to the algorithm improvement has been verified here.
  • GLAS has been released here.
Edited by Hua Yan