our Web application is relatively large and does a lot of computing in the background (or in the front-end JS running environment). This leads to obvious stutters in the user"s operations, such as touch and move, etc. The reason is that Main Thread is occupied by the code that does js in the background.
I looked up a lot of information and saw that Google"s Web development advice says to limit the length of each JS task to 50ms and to allow as much free time as possible for Main thread so that Main Thread can handle user input operations.
excuse me, how can I control how long a method will run?
is to write a large function into multiple small function? Or change the for loop or something to how often it is executed?
are there any related articles and tutorials to learn?
Thank you