Found during code review of #6718
ScopeEvaluator.invokeFilter() runs Arrays.stream(pred.getClass().getMethods()).filter(...) on every invocation. This is called per scope check (not()/exists() evaluation) on the hot path.
ReteEngine already resolves the Method once at wiring time (resolveTestMethod). ScopeEvaluator should do the same — cache the resolved Method on the LambdaConstraint at store time, or pass a pre-resolved Method alongside the predicate.
Refs #6718, #6714 (TupleFilterProcessor)
Found during code review of #6718
ScopeEvaluator.invokeFilter()runsArrays.stream(pred.getClass().getMethods()).filter(...)on every invocation. This is called per scope check (not()/exists() evaluation) on the hot path.ReteEnginealready resolves theMethodonce at wiring time (resolveTestMethod).ScopeEvaluatorshould do the same — cache the resolvedMethodon theLambdaConstraintat store time, or pass a pre-resolvedMethodalongside the predicate.Refs #6718, #6714 (TupleFilterProcessor)