-
Notifications
You must be signed in to change notification settings - Fork 162
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 getting very slow for growing/large lists #1699
Labels
Comments
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Jul 23, 2024
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.
This was referenced Jul 26, 2024
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Jul 29, 2024
hapifhir#1699 defer numberChildren to end of transform
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Oct 18, 2024
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. merge upstream
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Oct 18, 2024
hapifhir#1699 defer numberChildren to end of transform
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Nov 2, 2024
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Nov 2, 2024
instead of calling numberChildren() recursively whenever an element is added.
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Nov 2, 2024
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. merge upstream
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Nov 2, 2024
hapifhir#1699 defer numberChildren to end of transform
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Nov 2, 2024
mrunibe
added a commit
to mrunibe/org.hl7.fhir.core
that referenced
this issue
Nov 2, 2024
instead of calling numberChildren() recursively whenever an element is added.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have noticed that the FML transform is getting very slow if it is used with a large number of elements (target has an element with many children). I could reproduce it with a simple dummy testcase: A bundle with a large number of observations.
Runtimes for the transformations (time measured just for the transform() without loading resources):
The approx. quadratic increase of runtime is caused by the recursive call to
numberChildren()
for every child that is created withmakeElement()
. For every element that is added, the entire list of children is recursively re-numbered every time.With a workaround by disabling the numberChildren (mrunibe@a0f67d4), the performance becomes linear again:
The issue/numbers can be reproduced with the attached testcase.zip:
java org.hl7.fhir.validation.ValidatorCli testcase/bundle-10000.json -transform http://test.ch/DummyBundleToBundle -version 4.0 -ig testcase/map -output result-10000.json
Not sure if
numberChildren()
is required in themakeElement()
(the index seems to be used for the $index FHIRPath expression)? At least I have not observed any issues for the transform with the workaround.CC @oliveregger
The text was updated successfully, but these errors were encountered: