[TIMOB-26346] Android: Apps are notable slower when using main-thread
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 7.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Joshua Quick |
Created | 2018-08-31T12:51:33.000+0000 |
Updated | 2018-11-14T23:40:43.000+0000 |
Description
(Raised via Slack a few times so far)
I get a lot of
[INFO] : Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread.
If I press a button to open a new page, there is a slight delay, if I set run on main thread to false
its much smoother.
iOS seems to have no problems with run on main thread set to true
.
Note (Hans): This is rather meant to be an investigation ticket rather than expecting a concrete fix. We need to verify the performance differences and plan something for SDK 8.0.0, since main-thread will be the default moving forward. For iOS, the kroll-thread will be removed completely, but it seem to play fine by now.
Why was this removed from 8.0.0? There should be an investigation on the performance impact, since 8.0.0+ will only allow the main-thread to be used. By now, this is a blocker for updating to 8.0.0.
If someone is running into a performance issue, then it's likely something very specific. A "nebulous" ticket like this isn't very helpful. For example, if the APK is multidexed, then it will have a slow startup time on Android 4.x since OS versions older than 5.0 do not support multidexed apps. This means on Android 4.x, the app has to load the multiple dex libraries on app startup via software which is a long blocking operation. We can't fix that. You can only avoid it by either reducing the number of JARs or setting the min supported OS version to 5.0. Another example is image loading is blocking for all APIs other than
ImageView.image
on both Android and iOS. Such as "backgroundImage". If you use "backgroundImage" a lot, then consider using anImageView
instead for async image loading. And we're making optimizations all the time. We've optimized internal APK file access in 7.5.0. And we've added an async version ofWebView.evalJS()
in 8.0.0. Do you have anything specific you want to share with us?Also, you said you see a performance issue when opening windows. Does this only happen when analytics are enabled? We're currently posting analytics data on Android every time a window has been opened, closed, suspended, or resumed. We'll be changing this behavior in Titanium 8.0.0 to only report analytics when suspending/resuming the app like iOS instead. See: [TIMOB-26535] I'm curious if this is what you're seeing. Although, I'm not seeing a performance difference. Window open/close is fast for me.