1

I'm new to web development and I'm using multiple libraries for different purposes on my site. Can using all these libraries slow down my site's speed ??? Thanks!

Libraries used:

  • fontawesome
  • Jquery
  • animejs
  • smoothScrool
  • select2
  • etc
Dfranc3373
  • 1,880
  • 4
  • 28
  • 44
  • 1
    short answer is yes, it would make your initial page load slower, but not necessarily after that. longer answer is that there are ways to load things 'lazily', which is to say in the background, versus 'eager' loading, which would normally be the case. – Dan Oswalt Dec 31 '20 at 20:33

1 Answers1

1

They could if you have a lot of them.

  • Large numbers of parallel requests (say, more than 8 at once) may be throttled
  • If there's a large amount of code in the libraries, there's a lot of data to transfer. On slower connections, having to transfer large amounts of data before the site is functional is a problem.

To mitigate some of these issues, consider consolidating all the libraries into a single script file that you bundle together using a module bundler like Webpack. In addition, make sure to use tree shaking to remove code that will never be used, and also minify the code for production so that the least amount of code needs to be sent over the network as possible. You can also consider waiting to load the non-essential libraries (like smooth scrolling) until the libraries required for the site to be functional are ready.

CertainPerformance
  • 313,535
  • 40
  • 245
  • 254
  • Respected Certain Performance, thanks for a clearing me , How I can also consider waiting to load the non-essential libraries (like smooth scrolling) until the libraries required for the site to be functional are ready, – Ajmal Joiya Jan 01 '21 at 07:53