Come minimizzare il funzionamento del thread principale
How to minimize Main Thread Work
How does this rendering process work?
It processes user events as well: it can happen that your website does not react to the interactions of the user because the main thread is working on something else. This imply of course a bad user experience.
How the SeoChecker Main Thread work audit fails
If during the page loading its main thread is occupied for more than 4 seconds, SeoChecker displays an error.
Thanks to this table, SeoChecker is able to show you where the CPU spent its time waiting for the browser to load the page.
How can I minimize the Main Thread work?
Here is a list of tips divided by sections.
Style and layout
- do not use layout thrashing and complex/large layouts;
- make style calculation easier and diminish the scope.
- postpone non-critical CSS;
- extract critical CSS;
- minify CSS.
- using measureMemory() you can check the total memory usage of your web page.
- organize layer count and stick to compositor only properties;
- cut paint areas and make easier paint complexity.
Script compilation and evaluation
- if there is unused code, remove it;
- debounce input handlers;
- use web workers;