FHIR / sushi

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).
Apache License 2.0
145 stars 44 forks source link

Improve performance when exporting Instances #1443

Closed mint-thompson closed 6 months ago

mint-thompson commented 7 months ago

Fixes #1426 and completes task CIMPL-1242.

Instance export remains one of SUSHI's most time-consuming operations. This PR includes several changes that aim to reduce the amount of time needed to export Instances.

As examples of the benefits of these changes, here are a few selected repos from the regression set, with run times for SUSHI 3.8.0 and for this change set. These times are wall-clock times from my personal system, which are not perfectly accurate measurements of performance. However, I feel that the magnitude of the time reductions are significant.

Repo Number of Instances SUSHI 3.8.0 time (seconds) PR time (seconds)
HL7/fhir-saner#master 204 164 114
HL7/v2-to-fhir#master 247 114 68
joofio/test-epi-composition#main 2714 2362 290

In the regression set for this PR, some changes appear. However, these are due to existing bugs that were revealed by the changes in this PR. Two issues have been added to the SUSHI backlog for these bugs: https://standardhealthrecord.atlassian.net/browse/CIMPL-1248 and https://standardhealthrecord.atlassian.net/browse/CIMPL-1249

mint-thompson commented 6 months ago

One other thing I noticed is that the ElementDefinition.assignFshCode tests take a lot longer to run on this branch than on master.

Okay, so the good news is, it's not just you: this is also happening for me. This makes me think it's worth investigating, so I'll... investigate.

mint-thompson commented 6 months ago

I've made some small updates to comments. There's also a new issue for yet another bug discovered when investigating the differences in output on this branch. Next is investigating assignFshCode.