powerup-android icon indicating copy to clipboard operation
powerup-android copied to clipboard

Reducing the App startup time

Open codingblazer opened this issue 8 years ago • 6 comments
trafficstars

App takes around 10 sec on a cold start and also take significant time to start on warm start. Since theme based approach has been not accepted by mentors earlier, I will like to use tools like inline tracing and method tracer to identify the bottlenecks causing this problem. Also i will identify other problems as mentioned in this link - https://developer.android.com/topic/performance/launch-time.html @chhavip @anubhakushwaha Can i work on this ?

codingblazer avatar Jan 26 '17 23:01 codingblazer

@codingblazer Yeah you can go ahead and let us know your progress.

anubhakushwaha avatar Jan 27 '17 06:01 anubhakushwaha

I followed https://developer.android.com/topic/performance/launch-time.html and these are my findings and solutions -

  1. Ran the Inline Tracing and Systrace and stored the trace during the launch up time (White screen) Output - Html File (Open this file in browser) Solution - You can go to alerts tab in rightmost mid and see all things responsible for UI thread blocking (which causes delay for UI to show up). Clicking on any alert shows suggestions/solutions/video links to those problems. I propose to apply all those implementable solutions.

  2. Ran the method tracing using CPU profiling during the launch up time and the trace recorded is shown below. As you can see, the Rendering and drawing is taking major time. Solution - Currently, in activity_main.xml we have two drawables which can replaced by single drawable and that drawable too can be optimised further. Also I will set this drawable as theme property so that this image is shown instead of white screen.

screen shot 2017-02-05 at 12 52 38 am

  1. Will use some other performance enhancing things like -
  • Replacing heavy initialisations in onCreate() by lazy initialisation of objects in StartActivity.

  • Reducing Global variables

  • Reducing amount of work in onCreate() or using another thread so as to avoid blocking of UI thread.

@chhavip @anubhakushwaha @aanchal07 Should I send PR for these proposed solutions.

codingblazer avatar Feb 05 '17 07:02 codingblazer

These are good suggestions, but not possible to implement right now. They can and will be kept in mind during the next development cycle.

chhavip avatar Feb 05 '17 13:02 chhavip

@codingblazer Would you like to work on this now?

aanchal07 avatar May 16 '17 19:05 aanchal07

@aanchal07 I was thinking of taking this at end of this development cycle. There will be major changes this cycle and this performance issue will again come up at the end. What do you think?

codingblazer avatar May 18 '17 15:05 codingblazer

@codingblazer Alright then we can put this on hold for now.

aanchal07 avatar May 22 '17 17:05 aanchal07