Repository navigation
perf(eval): evaluate match detail in one pass - #613
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #612; merge that first.
Closes #591.
With
MatchDetailLevelaboveOff, a firing rule was evaluated three times: once to decide the match, once more to collect selection names, and a third walk to collect field matches, re-running every matcher (regexes included) on each pass.Changes
SelectionDetail { name, fields }), and the attribution rules from fix(eval): report only the selections that decide a match #612 decide which selections' fields survive. The separate field-collection walk is gone.ArrayMatchcomputes member verdicts once and reuses them for both the quantifier and the reported members.eval_conditiongoes through the same pass at levelOff.rsigma_runtime::EventFiltertakes the parsed line by value (dyn Fn(serde_json::Value) -> Vec<serde_json::Value>), andJsonEvent::into_valueis new. With no filter or a--jqfilter, the daemon andengine evalno longer copy each JSON line;--jsonpathcopies only the nodes it matches. This is a breaking change for custom filter implementors.Verification
eval_matched_detailbench (200 rules that all fire):Off252.47 to 243.90 µs (-3.1%),Full314.29 to 306.87 µs (-2.9%).rules/(793 matches) atoff,summary, andfull, and with--jq '.records[]'and--jsonpath '$.records[*]'over wrapped batches. The comparison sortsmatched_selections,matched_fields, and object keys, because selector member order andcustom_attributeskey order already vary between runs.