ExpressionRef Library context_values performance issue #329
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.
A performance slowdown has been identified when executing referenced CQL statements under certain conditions.
Assumptions
ExpressionDef
expressions are cached in their library context.ExpressionRef
expressions use those cached results.Issue
The CQL below performs in a degraded, non-cached way. We suspect the wrong context is used to store or lookup the cached context values when ExpressionRefs cross library contexts.
Test
CommonLib3:
Using CommonLib3:
The result of the library-test shows the perf degradation as if
ExpensiveStatement
was not being cached:$ npm test CommonLib3 ✔ should be able to execute an expensive expression (123ms) Using CommonLib3 ✔ should execute expression from included library at similar cost (565ms) ✔ should execute expression directly from included library at similar cost (291ms)
Solution
?
Please note there are no changes to src code, only tests were added to demonstrate the perf issue. Looking for feedback.
We hope that a fix can be identified and included with this PR.
Pull requests into cql-execution require the following.
Submitter and reviewer should ✔ when done.
For items that are not-applicable, mark "N/A" and ✔.
Submitter:
npm run test:plus
to run tests, lint, and prettier)cql4browsers.js
built withnpm run build:browserify
if source changed.Reviewer:
Name: