• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eterna2 / kest / 24286529711

11 Apr 2026 04:20PM UTC coverage: 90.965% (+0.003%) from 90.962%
24286529711

push

github

web-flow
⚡ [performance] optimize Rego package parsing in RegoLocalEngine (#33)

Replaced the line-splitting loop in `RegoLocalEngine._parse_package` with a pre-compiled regular expression. `splitlines()` and iterating through every line to find the package declaration is inefficient, especially for large Rego source files. A regex search is faster and more direct.

Measured improvements:
- Small Source: ~14% improvement
- Large Source: ~29% improvement

The implementation uses `re.search` with `re.MULTILINE` to find the package declaration efficiently while maintaining full functional parity with the original `strip()`-based logic.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: eterna2 <1248825+eterna2@users.noreply.github.com>

2789 of 3066 relevant lines covered (90.97%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.97
/engine.py


Source Not Available

The file "engine.py" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc