{ "id": "110573", "key": "ALOY-541", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14875", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-03-11T20:46:24.000+0000", "created": "2013-03-04T19:25:40.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-11T21:55:10.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": "12332", "name": "Titanium SDK", "description": "Any integration or issues with the TiSDK" } ], "description": "h4. Problem description\r\nCreating a large Table View (around 300 TableViewRows) is taking a long time, eventually failing to load.\r\n\r\n\r\nh5. Alloy version:\r\n\r\nh6. index.xml\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nh6. index.js\r\n{code}\r\nvar data = [];\r\n\r\nfor (var i=0;i<300;i++){\r\n    var tvr = Ti.UI.createTableViewRow({\r\n        title:'test' + i,\r\n    });\r\n    \r\n    data.push(tvr);\r\n\r\n    $.table.setData(data);\r\n};\r\n\r\n$.index.open();\r\n{code}\r\n\r\n\r\n\r\nh5. non-alloy version:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'white'\r\n});\r\n\r\nvar data = [];\r\n\r\nfor (var i =0; i<300;i++){\r\n\tvar tvr = Ti.UI.createTableViewRow({\r\n\t\ttitle: 'test' + i\r\n\t});\r\n\r\n\tdata.push(tvr);\r\n};\r\n\r\nvar tv = Ti.UI.createTableView({\r\n\tdata:data\r\n});\r\n\r\nwin.add(tv);\r\n\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: large TableViews take much longer to load or fail to open", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Alloy 1.0.0 \r\nTiSDK 3.0.2 GA\r\nAndroid devices (tested with Nexus 4 OS 4.2)", "comment": { "comments": [ { "id": "241639", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The code for the Alloy example is structured improperly. You have the setData() call inside the loop, which would essentially force it to update 300 times before rendering, accounting for the massive delay. I moved the setData() outside the loop and the performance becomes equal between the Alloy and traditional version.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-11T20:46:24.000+0000", "updated": "2013-03-11T20:46:24.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }