-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache node evaluation to reuse results within a run #811
base: main
Are you sure you want to change the base?
Conversation
fc96036
to
4384164
Compare
This will now cache rule evaluation between AST node of the same run. It prevents two equal AST nodes from executing at the same time, using the result for all concurrent instances. Also, it will use the cached result in subsequent instance of the same AST node.
4384164
to
752dc4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work !
Children []EvaluationStats | ||
} | ||
|
||
func BuildEvaluationStats(root NodeEvaluation, parentCached bool) EvaluationStats { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing how the main source of execution delay by is linked to computing aggregates today, I think this may be at the same time a bit overkill for generic nodes and lack of detailed breakdown for aggregates nodes (and perhaps tomorrow, for sanction check/api call nodes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(we can keep it though, it's fine)
The AST language is idempotent within a single run. We can assume that it is expected a node configured the same way returns the same result within a single run of a scenario.
This PR makes it so: