-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add caching for and/or and bring ItemsetBinding caching back #742
Conversation
Here are a few things I believe to be true:
Does my understanding seem right? Given all that, it feels like adding |
Agreed! Both should be lists of references to the same objects so the additional memory usage is hopefully very limited.
Yes.
This isn't quite true as far as I understand?
Yes should do!
Yeah! I'll let you look over answers here and then you can merge if it all seems ok! |
Ah yes, sorry. So I took another look at tests with repeats and at the structure of the cache key. I think it looks ok. |
This also adds the old caching for
ItemsetBinding
back in. This will mean that the last choice calculation for a question will always be cached for an O(1) lookup. This cache is evaluated when the non static parts of the nodes expression change.What has been done to verify that this works as intended?
New tests and verified performance improvement for forms with
and
in Collect (with./gradlew installLocal
.Why is this the best possible solution? Were any other approaches considered?
As discussed with @lognaturel, long term we'd like to reduce how often Collect calls
getSelectChoices()
to reduce the need for the caching code inItemsetBinding
. That aside, this level of caching will probably always be advantageous for cases where a data collector is navigating back and forwards to a question that other caching isn't covering.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
The main risk here is that the caching breaks some select choice calculations. It'd be good to try and think of ways this could happen.