0
votes

As per Sencha docs, Each Application can define a launch function, which is called as soon as all of your app's classes have been loaded and the app is ready to be launched.

However, even with the example app come with sencha generate app xxx, it takes several seconds before the lauch function is called, even with the bundled app.js. It definitely slows down development.

What exactly happens before an application's launch function is called and why is it so slow? The offcial doc is not detailed in this matter. How to speed up the process?

1

1 Answers

2
votes

Most of the time launching of app takes long time because of the below reasons

1.Unnecessary loading of controllers,views in app.js directly.

2.Unnecessary loading of static images/pdf(any static content) every time whenever we refresh the app.

Below steps would be useful,if you follow these properly,in any sencha touch app.

Do not load all controllers inside app.js directly,you can do loading of controllers device specific using profile,like below

profiles: ['Tablet', 'Phone'],

Above line would be in app.js,which is responsible for loading of corresponding profile,these profile files are further responsible for loading of all the controllers and views as per the device.

app.json file contains app.cache section,inside this there is cache section where you can mention all the static images or pdf,to avoid unnecessary loading every time.