{ "id": "64035", "key": "TIMOB-3403", "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": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-16T19:36:06.000+0000", "created": "2011-04-15T03:43:51.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "qe-port" ], "versions": [], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-29T05:34:16.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": "{html}

When you do an Ti.include(); in Android it is about 4x slower\r\nthan it is on iOS.

\r\n

Test Code

\r\n

app.js

\r\n
\r\nvar win = Titanium.UI.createWindow();\r\n\r\nvar bt = Ti.UI.createButton({\r\n    title: 'Start',\r\n    height: 60,\r\n    width: 150,\r\n    top: 150\r\n});\r\nbt.addEventListener('click', function(e){\r\n\r\n    var start = new Date().getTime();\r\n    \r\n    for(var i = 0; i < 1000; i++){\r\n        Ti.include('include.js');\r\n    }\r\n    \r\n    alert(new Date().getTime() - start + ' ms elapsed');\r\n});\r\n\r\nwin.add(bt);\r\nwin.open();\r\n
\r\n

include.js

\r\n
\r\nvar myVar = \"You're a string...no, I'm afraid knot\";\r\n
\r\n

Test Results

\r\n

For 1000 includes of 1 var

\r\n

iPhone4 4.2 - avg 1000ms
\r\nNexus one 2.2.2 - avg 4000ms
\r\nGalaxy Tab 2.2 - avg 3900ms
\r\nNexus S 2.3.2 - avg 5600ms

\r\n

Tested With

\r\n

TiSDK 1.6.1

\r\n

Associated Helpdesk Ticket

\r\n

http://developer.appcelerator.com/helpdesk/view/76547

{html}", "attachment": [], "flagged": false, "summary": "Android: include is much slower than on iOS", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "195059", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Tested this issue. The times were much better.", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-05-16T14:49:50.000+0000", "updated": "2012-05-16T14:49:50.000+0000" }, { "id": "195128", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "A number of performance improvements in 1.8.0.1 and 2.0.1 releases have resolved this issue.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-16T19:36:06.000+0000", "updated": "2012-05-16T19:36:06.000+0000" }, { "id": "216734", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Working fine now with much lesser time difference -\r\nOn iPhone 4S iOS 5.0.1 - Average time around 920ms\r\nOn Samsung GALAXY Note Android 2.3.6 - Average time around 1300ms\r\nEnvironment used for verification -\r\nTested with Titanium SDK: 2.2.0.v20120828153312\r\nTested with Titanium  Studio: 2.1.2.201208201549\r\nDevice - iPhone 4S iOS 5.0.1,Samsung GALAXY Note Android 2.3.6\r\nMachine OS - MAC 10.8", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-29T05:34:16.000+0000", "updated": "2012-08-29T05:34:16.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }