

Several plugins can help you delay JS and remove unused JS: It’s a way to let the browser render only the essential content without getting stuck with not-needed JS files. In other words, all the JS scripts that are useless or not included in the above-the-page content should be loaded only after the page’s rendering. It means that as long as no user clicks on a button or scrolls a page’s content, the browser will not execute any JS scripts. You should delay JS files so that none of them will be loaded until user interaction. Let’s see how you can implement each of these actions and address the PageSpeed Insights recommendation. There are three main ways to reduce JS execution time:
#Javascript time how to
JavaScript execution time – GTmetrix How to Reduce JavaScript Execution Time (Manually and With Plugins) In the example below, the JS execution time is above 2 seconds. You’ll then get the information about each JS stage. Go to the Structure tab, and look for the status of the JS execution time. When testing your URL’s performance, GTmetrix shows you a very similar audit.

Parsing, compiling, and executing are the three steps you should manage to reduce the JS execution time.Įvery time the JS execution is longer than 2 seconds, Lighthouse will report it as an issue to solve. Reducing JS execution time means reducing the time spent by the browser to parse, compile and execute JS once downloaded. How to Measure JavaScript Execution Time and Identify the Main JS Issues Since the TBT score accounts for 25% of the overall Lighthouse performance score, you can understand how your PageSpeed Insights score will be affected by JavaScript issues. The FID metric is closely tied to the Total Blocking Time (TBT), one of the Lighthouse performance metrics (based on Lab data).

That’s why you should try to reduce the size of these JS scripts as much as possible. If you try to interact with a page, and you don’t get any response, it means that the browser is busy processing some JS files. JavaScript execution time is closely related to the FID score, which measures the page’s interactivity and responsiveness. You can see how the JS execution time affects performance by looking at the First Input Delay metric and the Lighthouse performance score. What’s the Impact of JS Execution Time on Performance? Then, you’ll learn how to measure and identify the JS issues and how to reduce the JS execution time on your WordPress site, both manually and with some plugins.

In this article, you’ll first understand the impact of JavaScript execution on performance. Since JavaScript can hugely affect your WordPress site’s performance, it’s essential to manage any JS issues that slow down the loading time. Reducing JavaScript execution time is one of the most critical PageSpeed Insights recommendations.
