-
Notifications
You must be signed in to change notification settings - Fork 138
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 regression fix on using relative paths #248
Conversation
Class method __name_ should be a property.
Will allow use of lru_cache devorator.
This reduces the time by more than half i.e 46s down to 16s. It is still 4 times more than v0.11.5. Fix XLSForm#247
Returns True on first repeat occurance and caches with lru_cache. Part fix for XLSForm#247
0959e6e
to
6ccf57a
Compare
Thanks for the quick turnaround on this, @ukanga. If you need a beefier form to test with, HHS_FORM.xlsx is good too. |
@yanokwa Does relative referencing not apply to java.lang.RuntimeException: Error evaluating field 'p1': The problem was located in calculate expression for /HHS_FORM/g4/ts/cu5/u5_sick/g15/g16/g18/p1
XPath evaluation: type mismatch
indexed-repeat(): parameter 2 must be a parent of the field in parameter 1 The current release is generating the XML: <bind calculate="indexed-repeat( /HHS_FORM/g4/ts/cu5/u5_sick/g15/g16/g18/ros3/q38 , ../ros3 , 1)" nodeset="/HHS_FORM/g4/ts/cu5/u5_sick/g15/g16/g18/p1" type
="string"/> Should it always be? <bind calculate="indexed-repeat( /HHS_FORM/g4/ts/cu5/u5_sick/g15/g16/g18/ros3/q38 , /HHS_FORM/g4/ts/cu5/u5_sick/g15/g16/g18/ros3 , 1)" nodeset="/HHS_FORM/g4/ts/cu5/u5_sick/g15/g16/g18/p1" type
="string"/> @MartijnR Any thoughts on the above? Update:
|
Good discovery about I think one of the reasons |
Im pretty new to xpath so pardon my ignorance - "would a repeat" be a shared piece of the path or represent the same path entirely? Whats a good resource to get more familiar with XML/Xpath? I know what they are but not in great depth |
@KeynesYouDigIt if you have a model like this: <data>
<rep>
<questionA>yes</questionA>
</rep>
<rep>
<questionA>no</questionA>
</rep>
</data> The path The easiest way to refer to the second questionA node directly is If you want to dynamically populate the position (which is the most common), you'd have to do either:
or
(you've probably seen https://opendatakit.github.io/xforms-spec/#repeats) |
Cuts down performance hit introduced by the relative path functionality. We still get an additional 1 second in my test environment between v0.11.5 and this PR's branch, which is way better than the 38s+ introduced in v0.12.0.
This branch has the following times on my test environment:
v0.11.5 has:
v0.12.0 has:
Fix #247