Skip to content

Conversation

kddejong
Copy link
Contributor

Description of changes:

  • Pre-compute enabled rules set once at start of Rules.run()
  • Use fast set lookup instead of repeated is_rule_enabled() calls
  • Add enabled_rule_ids parameter to run_check() method
  • Reduces config property access calls from thousands to hundreds
  • Achieves ~32% performance improvement on large templates with many resources and errors

Fixes performance bottleneck where is_rule_enabled() was called for every match generated, causing excessive config property access through _get_argument_value().

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- Pre-compute enabled rules set once at start of Rules.run()
- Use fast set lookup instead of repeated is_rule_enabled() calls
- Add enabled_rule_ids parameter to run_check() method
- Reduces config property access calls from thousands to hundreds
- Achieves ~32% performance improvement on large templates

Fixes performance bottleneck where is_rule_enabled() was called
for every match generated, causing excessive config property
access through _get_argument_value().
@kddejong kddejong force-pushed the optimize-rule-filtering branch from 36d3d89 to 4cd4caa Compare August 17, 2025 16:28
Copy link

codecov bot commented Aug 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.48%. Comparing base (c06ba15) to head (4cd4caa).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4222      +/-   ##
==========================================
- Coverage   94.50%   94.48%   -0.03%     
==========================================
  Files         411      411              
  Lines       13948    13955       +7     
  Branches     2764     2767       +3     
==========================================
+ Hits        13182    13185       +3     
- Misses        422      425       +3     
- Partials      344      345       +1     
Flag Coverage Δ
unittests 94.46% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong kddejong merged commit e7e02b9 into aws-cloudformation:main Aug 17, 2025
21 checks passed
@kddejong kddejong deleted the optimize-rule-filtering branch August 17, 2025 16:35
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