question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow startup time on forms with many inputs

See original GitHub issue

I 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

image My test page: https://codesandbox.io/s/awesome-taussig-2c1c4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
felixmoshcommented, May 9, 2020

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 the attachToForm 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 :]

1reaction
rkuykendallcommented, May 9, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found