Skip to content

Conversation

madumas
Copy link

@madumas madumas commented Apr 17, 2025

This change significantly improves the performance of rule matching operations by implementing a Map-based lookup system. Previously, each deployment required a linear search through all rules, resulting in O(n*m) complexity for n deployments and m rules.

Key changes:

  • Implemented Map-based rule lookup for O(1) access to deployment rules
  • Added caching of global rule to avoid repeated searches
  • Introduced PreprocessedRules interface to maintain type safety
  • Optimized both evaluateDeployments and matchingRuleExists to use the new lookup system

This optimization is particularly impactful for large rule sets, reducing the complexity from O(n*m) to O(n) where n is the number of deployments. For example, with 800 rules and 15,000 deployments, the number of operations is reduced from approximately 12 million to 15,000.

@github-project-automation github-project-automation bot moved this to 🗃️ Inbox in Indexer Apr 17, 2025
@madumas madumas changed the title common: rule processing for performance common: rule preprocessing for performance Apr 17, 2025
@madumas madumas changed the base branch from release-v0.22.1 to main April 17, 2025 20:34
@madumas madumas changed the base branch from main to release-v0.22.1 April 17, 2025 20:35
@madumas madumas changed the base branch from release-v0.22.1 to main April 17, 2025 20:57
@madumas madumas marked this pull request as ready for review April 17, 2025 21:05
@madumas
Copy link
Author

madumas commented Apr 17, 2025

CI jobs appear to be failing due to permissions or because I'm outside the org

@github-project-automation github-project-automation bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

2 participants