Performance Improvement by Lazy Loading

Pawan Kumawat
2 min readFeb 24, 2022

I have seen many enterprise Angular applications where the size of main.js was more than 20 MB and response time was so long that we would often take mini coffee breaks which would always result in our bad performance and bad performance for the site as well.

So keeping such performance issues in mind, Angular provided a solution called “Lazy Loading”. It reduces the size of the initial bundle, response time and eliminates frequent coffee breaks.

We can segregate our modules into eager and lazy modules. We can keep those modules that are required on initial load as “eager modules” and those which are required at a later point of time as “lazy modules”. All the modules are by default eager and we can convert eager modules to lazy modules.

A picture is worth a thousand words and Video is worth a thousand blogs.

To explain this topic, I have created a video on YouTube. Please go through it.

“If you change the way you look at things, the things you look at change.” — Wayne Dyer.

I hope you got the concept.

Please do subscribe/clap (You can give 50 claps) /like. It spurs me to write more such blogs.

I’ve created an Angular Course on Udemy which covers many practical problems and solutions in Angular including this one. It could be a stepping stone in your professional Angular Journey. Please take a look.

Angular-Practicals
Angular-Practicals

You can also watch/subscribe my free YouTube channel.

Please subscribe/follow/like/clap.

--

--