Clutch

Addy Osmani named the bottlenecks for loading JS scripts in 2019

Addy Osmani named the bottlenecks for loading JS scripts in 2019
Average rating: 0
(0 votes)

You probably are familiar with Addy Osmani, engineering manager at Google working on Chrome. He is the author of open-source projects like Yeoman and has published a great number of articles. Recently we shared with you JavaScript loading Priorities in Chrome explained by him. And today Addy Osmani named the bottlenecks for loading JS scripts in 2019 and we are going to present you the main issues.

The new article by Addy Osmani is called The Cost of Javascript and explains how the dominant costs of processing scripts are download in 2019. He marks the three things to focus on for JavaScript bundles:

  • The download time needs to be improved
    You can do that with the help of using small bundles that cause lower memory usage and can reduce CPU costs.
  • The execution time needs to be improved
    Here you need to remember about Long Tasks that can keep thread busy. Try to avoid them.
  • Don’t write large inline scripts
    Avoid inlining script that is over 1 kB

Addy Osmani describes why it’s important to optimize download and execution times and how it influences the whole network and gives examples of real-world sites and how the script streaming was applied. For example, the script resources can be compiled and that means that V8 can parse JavaScript without blocking its thread. V8 optimization can help in solving many problems because when a script requested, Chrome downloads it and gives it to V8 to compile. So, it can store the file in the browser and when JS file is needed for the second time, Chrome uses the file from the browser and again transfers it to V8 to compile. That’s when the compiled code is attached to the cached script file as metadata.

In short, the download and execution time are the main bottlenecks for loading scripts in 2019. To find out more about other important issues to optimize them read the full article.

And read our blog to be always aware of everything that’s happening.

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111