Search code examples
javascriptangularrendering

Angular 4+ App slow rendering on mobile


My angular app runs terribly slow in mobile so I carried a test and found out that the javascript execution time (after the bundle.js gets loaded) is the main bottle neck. There's a huge difference in them between desktop to that on a mobile.

What might be causing the problem and what might be the possible solutions?

Test for desktop enter image description here

Test for mobile(Moto G) enter image description here

You can see the JS Execution time is denoted by the purple bar.


Solution

  • Please have a look at the page speed suggestions by Google for your site.

    https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Faiesec.org&tab=mobile

    Try to make the changes mentioned and test again to see if it makes it any better.

    Move the render blocking js to the footer. That's the one thing I noticed when checked the source from my mobile.

    Please have a look at the below question

    How can I improve load performance of Angular2 apps?

    I have seen the initial slow issue on many angular apps even though they have been optimized with production build. Please have a look at that it may help.