datreeio / datree

Prevent Kubernetes misconfigurations from reaching production (again 😤 )! From code to cloud, Datree provides an E2E policy enforcement solution to run automatic checks for rule violations. See our docs: https://hub.datree.io
https://datree.io
Apache License 2.0
6.4k stars 359 forks source link

perf: cache compiled rules to improve performance by 30% #944

Closed royhadad closed 1 year ago

royhadad commented 1 year ago

Note: this is a quick win. If we need to improve performance even further in the future, we should use proper performance profiling, and implement some bigger refactors :)

Scanner performance with ~200 resources and 62 rules enabled Before: Screenshot 2023-06-07 at 10 44 19

After: Screenshot 2023-06-07 at 10 46 32