Search code examples
nativescriptangular2-nativescript

Does it worth to go for lazy loading for a Nativescript app?


I am half way migrating an ionic app to Nativescript. As I was Googling I found some articles and repos about lazily loading modules in {N}.

e.g. https://github.com/sis0k0/lazyNinjas

I am not really sure why to care for lazy loading while all app files are already stored in the device. Does it have any performance improvement? If any, how?

Should I consider restructuring?

Thanks.


Solution

  • The performance increase you will have is mainly on loading time. As the modules are lazily loaded, your application needs to parse less code when it first loads so you get this boost. Please note that users tend to like a lot when apps open fast and are ready to use as soon as they tap them.