-
Notifications
You must be signed in to change notification settings - Fork 18
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
Performance update for 1.0 #590
Conversation
@baseTwo - is this something we need in your equivalent 2.0 port as well? |
We have an issue to add memoization as part of the context #600, however, it looks like 1.0 changed back to the old way where most libraries contain state for the context and the Lazy<>'s. @DamienMosier , which measures do not have context defined, I'd like to compare the two types, but GitHub collapses too many files for me to go through each one until I find it. |
@ewoutkramer this is something you would definitely want in the 2.0 branch for the performance gains. @baseTwo The way the logic work is if the file or one of the includes has a context then it creates it the old way with a constructor and utilizes Lazy. If the file does not, aka a library, then it's a singleton. For our use case only our actual measures have context Patient and all of our libraries are either functions or fluent functions with the resources passed in. In your Demo project, context is added to almost all files which is why it looks like the old way. The main performance issue with the original 1.0 branch was with the constructors. If you have LibraryA that has 5 includes and each of those subsequent libraries each have their own set of includes. You could end up instantiating the same library multiple times. Having it scoped allowed us to use Lazy so we gained the benefit of some caching but at the expense of calling the constructors a lot. Switching to singleton removed that constructor lift but removed the ability to use Lazy. I thought about it and realized we only need Lazy where there is context and all subsequent libraries did not need it and we could have the best of both worlds. Here are some partial examples of measure AAB from DQIC if you want to see the CQL.
and the actual file with context is reverted to the old way, the same way you see files in the DQIC repository.
|
Current 1.0
ADD-E: Duration: 3h 32m 35s
CRE: Duration: 2h 46m 1s
PND-E: Duration: 10h 48m 39s
SPD: Duration: 3h 10m 21s
Time to run 80 HEDIS measures with multiple configurations using current develop 1.0 branch
![image](https://private-user-images.githubusercontent.com/67708725/374599391-0acdef5d-36f3-4a34-a0b0-529a9d57e517.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDA3MjQsIm5iZiI6MTczOTQ0MDQyNCwicGF0aCI6Ii82NzcwODcyNS8zNzQ1OTkzOTEtMGFjZGVmNWQtMzZmMy00YTM0LWEwYjAtNTI5YTlkNTdlNTE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA5NTM0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzOTIxMDI5YzQ1YzE4YTVjMmQxNTZjMjQ5ZjdjNDRiNTVhYzgyMDM2YzMzYzU4MDE1NmM1MDk0ZDExYjgxN2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8dBCt56KRvlyoJciBCgOPwsG9VL1vy16dUeyK-SIpBw)
With these updates, same build pipeline
ADD-E: Duration: 38m 0s
CRE: Duration: 57m 4s
PND-E: Duration: 53m 39s
SPD: Duration: 1h 36m 22s