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

Slowdown due to reusable form defintions lookup when loading/starting a form. #3491

Closed
LaurensBurger opened this issue Sep 19, 2023 · 1 comment · Fixed by #3542
Closed

Comments

@LaurensBurger
Copy link
Collaborator

LaurensBurger commented Sep 19, 2023

Product versie / Product version

2.3.0

Omschrijf het probleem / Describe the bug

Internal: LV 107

When a user creates a new form, or opens a existing form: Open forms always looks up all "reusable" form definitions.

The calls to this endpoint: /api/v2/form-definitions?is_reusable=true&page=1&used_in= are paginated with 24 items per page.

The paginated results contain all the data of the form definition, including translation.

When the total amount of reusable form definition grows, the loading time automatically grows along with it.
Example:
environment with 416 defintions:
image
Each request takes approx: 600ms x 17 = 10 seconds of loading only form definitions each time a form is opened or a new form is added.

This seems rather long and can only increase with the amount of forms but also extra data (translations) being included in these requests.

@LaurensBurger LaurensBurger added bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid. labels Sep 19, 2023
@LaurensBurger LaurensBurger changed the title Slowdown due to reusable form defintions lookup when loading a form. Slowdown due to reusable form defintions lookup when loading/starting a form. Sep 19, 2023
@joeribekker
Copy link
Contributor

Refinement: We can create a separate endpoint to only return the name/uuid to prevent the heaps of data returned for the pulldown. We do need to refactor the client to retrieve the form definition detail when you actually want to use it. Pagination can be dropped for this endpoint. Sergei is not convinced so i'll let this sink in a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants