Skip to content

Move dfa cache in scan data - #264

Open
vthib wants to merge 3 commits into
masterfrom
move-dfa-cache-in-scan-data
Open

Move dfa cache in scan data#264
vthib wants to merge 3 commits into
masterfrom
move-dfa-cache-in-scan-data

Conversation

@vthib

@vthib vthib commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Instead of storing the DFA caches in the matchers in a thread local pool, store them in the ScanData, forcing recreation on new scan, and drop at the end.

This replaces caches that could only grow, with versions per thread, with temporary memory that is
released after the scan ends. Performance wise, it is unclear how much this has an impact. The cache is no longer shared between scans, but scans may not need the same caching. Redoing some benchmarks would be useful.

vthib added 3 commits August 8, 2026 13:17
Instead of storing the DFA caches in the matchers in a
thread local pool, store them in the ScanData, forcing
recreation on new scan, and drop at the end.

This replaces caches that could only grow, with multiple
versions per thread, with temporary memory that is
released after the scan ends. Performance wise, it is
unclear how much this has an impact.
Removing the Arc around the DFA made the validator size explode.
Box it to ensure it does make the HalfValidator & Validator enums
huge because of this single element.
Instead of duplicating the handling of the reverse matches
in each validator branch, use an intermediary object so
that this logic is not duplicated and does not risk drifting.
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.30070% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.31%. Comparing base (dccf06c) to head (631fc28).

Files with missing lines Patch % Lines
boreal/src/matcher/validator.rs 96.42% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #264   +/-   ##
=======================================
  Coverage   98.31%   98.31%           
=======================================
  Files          94       94           
  Lines       26938    26981   +43     
=======================================
+ Hits        26483    26526   +43     
  Misses        455      455           

☔ View full report in Codecov by Harness.
📢 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.

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