[Vuejs]-Performance Impact of many Vue.js components

0👍

There is no performance difference per se, of having 100 or 10 components in the same file.

The difference is that you’re requesting the user’s browser to load a 100 components instead of 10.

Code splitting the file works great if you’re using an SPA, but if you want to use Vue in-page, it’s, obviously, not ideal.

What you could do, however, is have all components be loaded as one file, and the vue instances that use them across multiple pages reference them. That way when you go from page to page you’re not requiring the user to load new sets.

If you want to have actual performance improvement, you can optimize the rendering as much as possible, as there you will find the most noticeable gains. One way is to convert components to functional components, which can make an impact if you have lots of components re-rendering frequently, but it doesn’t seem like that’s the case.

Leave a comment