{ "id": "137573", "key": "AC-3286", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2015-04-06T23:23:53.000+0000", "created": "2014-10-02T01:50:51.000+0000", "labels": [ "Performance", "TCSupportTriage", "button", "label", "scrollView", "speed" ], "versions": [], "issuelinks": [], "assignee": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "updated": "2016-03-08T07:57:42.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "A ScrollView with a vertical layout and 1000 labels takes \r\napproximately 59 seconds to load with a Titanium compiled App on an iPad mini, and approximately\r\n0.850 seconds to load with native iOS code on the same iPad mini.\r\n\r\nSTEPS TO REPRODUCE\r\n1. Create new mobile app project\r\n2. Choose default Alloy Project\r\n3. Copy and paste the following code into their respective files\r\n\r\nindex.xml\r\n\r\n{code:xml}\r\n\r\n \r\n \r\n \r\n \r\n{code}\r\n\r\nindex.tss\r\n\r\n{code}\r\n \".container\": {\r\n backgroundColor:\"white\"\r\n }\r\n{code}\r\n\r\nindex.js\r\n\r\n{code:javascript}\r\n var startTime = new Date();\r\n startTime = startTime.getTime() / 1000;\r\n \r\n $.index.addEventListener('postlayout', calculateTimeToLoad);\r\n \r\n loadThousandTextFields();\r\n \r\n function calculateTimeToLoad() {\r\n $.index.removeEventListener('postlayout',calculateTimeToLoad);\r\n var endTime = new Date();\r\n endTime = endTime.getTime() / 1000.0;\r\n \r\n Ti.API.info(\"Total time taken:\" + (endTime - startTime) + \" seconds\"); \r\n }\r\n \r\n function loadThousandTextFields() {\r\n for(var i = 0; i < 1000; i++) {\r\n $.scrollView.add(Ti.UI.createTextField({\r\n hintText: \"Hint text\"\r\n }));\r\n }\r\n }\r\n \r\n $.index.open();\r\n\r\n{code}\r\n\r\nThe time taken is output in the console. Can be replaced with an alert to more easily see in application.\r\n\r\n*Further Notes*\r\n\r\nTesting with version 3.2.3 GA produced similar results, however, 1000 buttons took approximately 0.950 seconds when only title was specified, but took approximately 5 seconds when attributes, such as width/height were specified (this was tested on iOS 3.5\" iPhone simulator).\r\n\r\nOur team spoke with Stephen Feloney about this issue.\r\n", "attachment": [], "flagged": false, "summary": "ScrollView with views loads very slowly compared to similar native iOS code.", "creator": { "name": "Andrey", "key": "andrey", "displayName": "Andrey Melnikov", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Andrey", "key": "andrey", "displayName": "Andrey Melnikov", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Application type: mobile\r\n\r\nTitanium SDK: Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA\r\n\r\nDevice: iPad mini\r\n\r\nHost Operating System: OSX 10.9.3\r\n\r\nTitanium Studio, build: 3.3.0.201407100905 Build: jenkins-titanium-rcp-master-164 (origin/master)", "comment": { "comments": [ { "id": "327785", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello! \r\n\r\nyou will gain performance by using the ListView. \r\n\r\nhttp://docs.appcelerator.com/titanium/3.0/#!/guide/ListViews\r\n\r\nin general, we don't recommend to create several hundred buttons or items in the screen, we recommend to use lazy loading techniques in order to accomplish a better user experience. \r\n\r\nBest Regards ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-10-12T13:55:50.000+0000", "updated": "2014-10-12T13:55:50.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }