Use formik 'FastField' instead of 'Field' for performance reasons#1408
Conversation
On an Opencast system with a large number of series (>4,000), entering text in the create or edit event dialogue box is slow. Using the formik 'FastField' instead of 'Field' improves the performance. Fixes opencast#1406
|
Use Run test server using develop.opencast.org as backend: Specify a different backend like stable.opencast.org: It may take a few seconds for the interface to spin up. |
|
@snoesberger can you explain why the text inputs are slow when there are many series? This seems very strange to me, and I'm wondering if there is something else that should be optimized. The |
Each time you enter an additional character in one of the text fields, the entire form is rendered again. And the more series you have, the slower it gets. After searching the internet, I found a proposal to use 'FastField' instead of 'Field'. I also read the Formik documentation and saw the warning you mentioned. According to the explanations, using 'FastField' can cause problems if one field depends on another. Having checked the admin UI code, I found no such dependencies; the user password and password confirmation fields are also still working correctly. Or do you see maybe dependencies between fields that I have missed? |
I don't really dabble in frontend code. So others have to answer that. This issue was just surprising to me. So the underlying problem seems to be that all series are loaded and the fields check for dependencies among each other during each update? I guess if fields don't depend on each other, this is a valid quickfix, but the real scaling problem is having all series in-memory / in the DOM instead of loading only a partial list based on the search term. |
|
I've not used I do agree that the better long term solution would be to figure out why
is happening, and then make it not do that. If a field is changed, only that field needs re-rendering should re-render, not the entire form. But maybe it's better to leave the long term solution stuff to a different PR, and just use |
|
Tested this and it really helps quite a bit 🚀 |
|
I agree. If someone sees a better solution, I'd love to see that. For now, though, the admin UI is hardly usable for admins on systems with many series. Therefore, I would greatly appreciate it if this PR could be merged. |
On an Opencast system with a large number of series (>4,000), entering text in the create or edit event dialogue box is slow. Using the formik 'FastField' instead of 'Field' improves the performance.
Fixes #1406