Skip to content

Improve validator performance at scale - #374

Merged
satyakigh merged 2 commits into
mainfrom
optimize-validation-performance
Sep 7, 2026
Merged

Improve validator performance at scale#374
satyakigh merged 2 commits into
mainfrom
optimize-validation-performance

Conversation

@satyakigh

@satyakigh satyakigh commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

This change significantly improves performance for applications that synthesize large numbers of templates.

  • Enabled concurrent Rego validation by replacing shared mutable evaluation state and the global lock with per-thread evaluation contexts.
  • Added bounded per-thread caching for compiled Rego regex patterns.
  • Skipped globally filtered built-in rules before evaluation using guarded Rego clauses.
  • Optimized intrinsic-source lookups, reference-graph iteration, and intrinsic-name suggestions.
  • Prevented cross-template leakage of custom rule descriptions, schema scenario filters, regions, models, and suppression state.
  • Hardened shared pattern caches against poisoned locks.

Overall performance

Engine Before After Improvement
Rego 178.86 s 78.80 s 2.27x faster
CEL 39.74 s 32.89 s 17.2% faster

Concurrent validation through one shared Rego engine improved from 9.29 seconds to 3.26 seconds with four workers, a 2.85x speedup.

@satyakigh
satyakigh force-pushed the optimize-validation-performance branch from 8c8e043 to f4bc527 Compare September 7, 2026 03:16
@satyakigh
satyakigh merged commit e72406d into main Sep 7, 2026
22 checks passed
@satyakigh
satyakigh deleted the optimize-validation-performance branch September 7, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant