{ "id": "176264", "key": "TIMOB-28516", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21243", "description": "", "name": "Release 10.0.2", "archived": false, "released": true, "releaseDate": "2021-08-10" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-08-09T09:24:41.000+0000", "created": "2021-08-02T09:52:03.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ScrollableView", "android", "performance", "regression" ], "versions": [ { "id": "21199", "description": "", "name": "Release 10.0.1", "archived": false, "released": true, "releaseDate": "2021-07-28" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-08-09T09:24:41.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "We noticed an increased lack of performance (on the UI thread) when using SDK 10.0.1 and beyond. The issue is reflected by the following log (shown > 25 times due to our high usage of card views):\r\n{code}\r\n[INFO] MaterialCardView: Setting a custom background is not supported.\r\n{code}\r\nOur main list (uses card views a lot), which is inside a scrollable view. So could this maybe be a regression from the recent changes in the Ti.UI.ScrollableView?\r\n\r\nIt can be easily reproduced in our app by using a 10_0_X build vs 10.0.0.GA and adding a new POI inside a waypoint. Usually, it redraws in 1-2 seconds (by the socket update), but now it takes up to 8 seconds due to the UI thread being blocked.", "attachment": [], "flagged": false, "summary": "Android: Setting ScrollableView \"views\" property after window open slower as of 10.0.1", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "458945", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], your app's startup time does not seem any slower between Titanium 10.0.0, 10.0.1, and 10.1.0.\r\n\r\nA cold-start of your app takes about {{5 seconds}} on my device for the \"debug\" version, which is what the CLI builds when the deployment type is \"test\" or \"development\". In your \"build.gradle\", I can disable debugging in the debug build (I know that sounds weird) via the following \"build.gradle\" setting and the launch time is about {{2 seconds}}, which is about the same time your release version on Google Play takes.\r\n{code:groovy}\r\nandroid.buildTypes.debug.debuggable false\r\n{code}\r\n\r\nSo I think it's just the traces/debug messages that Google outputs that's making it take longer. Also, the \"debuggable\" setting makes the Android OS check for private API usage and probably some other things.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-03T21:34:15.000+0000", "updated": "2021-08-03T21:34:15.000+0000" }, { "id": "458947", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also the MaterialCardView warning won't cause this performance issue. Looking at Google's code, it simply logs that message and replaces the color drawable. We can override this behavior when setting the \"backgroundColor\" to get rid of this warning message, but it has nothing to do with the performance issue you saw.\r\nhttps://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/card/MaterialCardView.java#L362-L371\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-04T03:01:32.000+0000", "updated": "2021-08-04T03:01:32.000+0000" }, { "id": "458949", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "How expensive are the {{getViews()}} calls in https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollableView.java ? Eg. in {{onPageScrollStateChanged}} there are 3, in {{onPageScrolled}} are 4; before it was just {{mViews}}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-08-04T10:03:17.000+0000", "updated": "2021-08-04T10:03:17.000+0000" }, { "id": "458950", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The {{getViews()}} just returns the collection reference as-is. So, there's no issue there.\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollableView.java#L379\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollableViewProxy.java#L139\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-04T15:53:08.000+0000", "updated": "2021-08-04T15:53:08.000+0000" }, { "id": "458951", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This really worries me. @Josh: Can you go ahead and add a waypoint on the waypoint map and compare the time between the pin is drawn between 10.0.0 and 10.0.2? We literally swapped SDK versions and saw a difference of 4x in redraw performance", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-08-04T20:04:52.000+0000", "updated": "2021-08-04T20:04:52.000+0000" }, { "id": "458952", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tested your app with your \"hans2\" account.\r\n\r\nOn my Pixel 3a device running Android 11 the app startup times are...\r\n* Titanium [PR #12989|https://github.com/appcelerator/titanium_mobile/pull/12989] - debug build: {{5 seconds}}\r\n* Titanium [PR #12989|https://github.com/appcelerator/titanium_mobile/pull/12989] - release build: {{2 seconds}}\r\n* Titanium 10.0.0.GA - debug build: {{5 seconds}}\r\n* Titanium 10.0.0.GA - release build: {{2 seconds}}\r\n\r\nOn my Android 12 emulator, the app startup times are...\r\n* Titanium [PR #12989|https://github.com/appcelerator/titanium_mobile/pull/12989] - debug build: {{13 seconds}}\r\n* Titanium [PR #12989|https://github.com/appcelerator/titanium_mobile/pull/12989] - release build: {{11 seconds}}\r\n* Titanium 10.0.0.GA - debug build: {{13 seconds}}\r\n* Titanium 10.0.0.GA - release build: {{11 seconds}}\r\n\r\nSo, I'm not seeing a difference in app startup times between 10.0.0.GA and the Titanium SDK I've built with [PR #12989|https://github.com/appcelerator/titanium_mobile/pull/12989]. The emulator startup times are pretty bad and I'm not sure why yet, but on a real device the startup times are good.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-04T22:41:41.000+0000", "updated": "2021-08-04T22:41:41.000+0000" }, { "id": "458959", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm able to reproduce this performance issue. It's caused by setting the \"views\" property after the window has opened. As of 10.0.1, we release all of the native views in the last \"views\" array before assigning it new views. This would normally be okay except when the new array contains the same views as before in which case we don't want to release them (this is what [~hknoechel] is running into).\r\n\r\nAlso we're notifying the native view adapter for every view in the array when we should only invoke this notification once after adding all views.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-06T03:25:48.000+0000", "updated": "2021-08-06T03:25:48.000+0000" }, { "id": "458960", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Regarding the CardView warning message, it's harmless.\r\nWe'll look into resolving it via ticket [TIMOB-28517] which is a good opportunity to support \"touchFeedbackColor\" which has always been ignored before.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-06T03:27:00.000+0000", "updated": "2021-08-06T03:27:00.000+0000" }, { "id": "458962", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13001", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-08-06T04:03:18.000+0000", "updated": "2021-08-06T04:03:18.000+0000" }, { "id": "458966", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The issue is now fixed - brilliant work, Josh, thank you!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-08-06T12:25:34.000+0000", "updated": "2021-08-06T12:25:34.000+0000" }, { "id": "458969", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Merged to master and 10_0_X", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2021-08-09T09:24:36.000+0000", "updated": "2021-08-09T09:24:36.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }