Skip to content
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

FML transform performance tuning #1704

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mrunibe
Copy link

@mrunibe mrunibe commented Jul 26, 2024

Imrove performance of FML transform, especially for data with large lists.

For large amount of input/output data, FML transform is > 1000x faster and using less memory.

mrunibe and others added 2 commits July 23, 2024 15:14
hapifhir#1699 Workaround for performance issue with FML transform: Growing/large lists getting very slow due to numberChildren() getting called recursively for every element that is added to a list.
hapifhir#1703 FML transform create heavyweight
FHIRPathEngine objects for every new Property. Re-use existing
ProfileUtilities/FHIRPathEngine objects from StructureMapUtilities.
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 12.50%. Comparing base (33cb80d) to head (5a2bcf7).
Report is 21 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1704      +/-   ##
============================================
+ Coverage     12.49%   12.50%   +0.01%     
- Complexity    32218    32254      +36     
============================================
  Files          2203     2203              
  Lines        673493   673623     +130     
  Branches     198556   198592      +36     
============================================
+ Hits          84122    84213      +91     
- Misses       559399   559419      +20     
- Partials      29972    29991      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@grahamegrieve
Copy link
Collaborator

why is it ok to skip numberChildren() when changing the list?

@mrunibe
Copy link
Author

mrunibe commented Jul 27, 2024

why is it ok to skip numberChildren() when changing the list?

At least during the transform I have not seen where the index is used. But maybe we can just defer numberChildren() until the end of the transform? For example, do it when sorting:

executeGroup("", context, map, vars, g, true);
if (target instanceof Element)
((Element) target).sort();

I've also noticed the numbering is not done in other place like forceElement or addElement, making me naively assume it might not be required in makeElement either.

Do you think deferring it to the end of transform() is ok?

hapifhir#1699 defer numberChildren to end of transform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants