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

Improve initial load for calculated-expression #2519

Open
FikriMilano opened this issue Apr 23, 2024 · 1 comment · May be fixed by #2522
Open

Improve initial load for calculated-expression #2519

FikriMilano opened this issue Apr 23, 2024 · 1 comment · May be fixed by #2522
Assignees
Labels
P2 Medium priority issue type:performance

Comments

@FikriMilano
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
The initial load calculated-expression algorithm is very inefficient:

  • In a nutshell what it does right now is, for each questionnaireItem, find other questionnaireItems that's using calculated-expressions, then process the calculation.
  • Problem is, it's finding ALL calculated-expression for each questionnaireItem, so in one of our forms, we have around 420 normal questionnaireItem, and 80 questionnaireItem with calculated-expression within a form, it will be 33.600(420*80) processes in total. Each calculated-expression is processed 420 times and it's a waste of resource, 1 time is enough. This is a rough estimation, but you see my point.

Describe the solution you'd like
During initial load, directly find all calculated-expression within a form, and process that. It will be 80 process in total.

Describe alternatives you've considered
N/A

Additional context

  • The following is total calculation and the time it takes to process it
  • Before improvement (~70 seconds)
Screen Shot 2024-04-23 at 08 12 36
  • After improvement (<1 second)
Screen Shot 2024-04-23 at 08 12 48

Would you like to work on the issue?
Yes

@FikriMilano FikriMilano linked a pull request Apr 23, 2024 that will close this issue
7 tasks
@FikriMilano
Copy link
Collaborator Author

@pld @f-odhiambo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Medium priority issue type:performance
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

2 participants