Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does bundle size affects performance?

Let's say that the final bundle produced by webpack is around ~15MB.
Besides slow loading for the first time on the site, are there any significant performance issues comparing to let's say 500KB bundle? (that has been uglified, or used .min npm packages)

like image 860
Ron Zano Avatar asked May 14 '26 18:05

Ron Zano


1 Answers

Performance implications include:

  • Time to transmit over the network. Especially consider slow connections with some mobile devices. Depending on what you're doing it's possible your page will not be interactive until it loads.
  • JS parse time. Modern JS engines are fast, but the more code you load the more the browser must parse through.
  • JS execution time. Optimally you'd only pack code you expect to execute. The more code you want to execute the longer it will take. Again it's possible your page won't be interactive until much of this completes, depending on the details.
  • Memory consumption. Everything takes up space: the code itself, runtime variables, DOM elements created, etc.

It's important to use the developer tools of your favorite browser to analyze the impact of your code. Be sure to remove any JS your site doesn't really need.

like image 95
Matt S Avatar answered May 16 '26 08:05

Matt S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!