Slow startup time on forms with many inputs
See original GitHub issueI have a large form (100+ checkboxes) on one of my pages, it takes more then 3 sec to initial render it. After the initial render it works properly.
I’ve checked what make it stuck, and looks like that the attachToForm
method which each input is calling on mount and it triggers validation for each insert, maybe it is better to debounce the call for form
.
attachToForm -> validate(Input) (which calls to setState) -> validateForm (which calls to setState)
This chain of calls means that there are many formValidation (Arithmetic progression) which is redundant, cause onMount of the form it self there another call for validateForm
My test page: https://codesandbox.io/s/awesome-taussig-2c1c4
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
React slow with multiple controlled text inputs - Stack Overflow
I have a form with multiple text inputs. I have them all set up as controlled inputs. When typing, there is a lag...
Read more >Input slow and high CPU on large forms · Issue #24670 - GitHub
When having a large table with several inputs there is a noticeable lag in the input box. Also CPU usage stays at 12.5%...
Read more >How to Fix Input Lag and Slow Performance in Google Chrome
Within Chrome, go to Settings window and click on Advanced > Reset and clean up. Then, click on Restore settings to their original...
Read more >App startup time - Android Developers
This section discusses several issues that often affect apps' startup performance. These issues chiefly concern initializing app and activity ...
Read more >Severely slow startup time on Azure - Optimizely World
I'm not the most experience Episerver person around, and recently did a migration of our site from Azure Hosted VM's to Azure App...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve another path to fast render… there is redundant update due to call of the
attachToForm
onMount which changes the state of the component, I think that If theattachToForm
will be called in the constructor and will return the initial state of the component this will improve start-up time.Will experiment with this idea :]
Debouncing makes sense. This seems like a really fun project. I might try it if nobody else gets around to it. How did you test your performance changes? I’m wondering if a simple .html “performance test suite” could be written which uses the UMD build?