Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3403] Android: include is much slower than on iOS

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2012-05-16T19:36:06.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.0.1
ComponentsAndroid
Labelsqe-port
ReporterJon Alter
AssigneeNeeraj Gupta
Created2011-04-15T03:43:51.000+0000
Updated2012-08-29T05:34:16.000+0000

Description

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

Test Code

app.js

var win = Titanium.UI.createWindow();

var bt = Ti.UI.createButton({
    title: 'Start',
    height: 60,
    width: 150,
    top: 150
});
bt.addEventListener('click', function(e){

    var start = new Date().getTime();
    
    for(var i = 0; i < 1000; i++){
        Ti.include('include.js');
    }
    
    alert(new Date().getTime() - start + ' ms elapsed');
});

win.add(bt);
win.open();

include.js

var myVar = "You're a string...no, I'm afraid knot";

Test Results

For 1000 includes of 1 var

iPhone4 4.2 - avg 1000ms
Nexus one 2.2.2 - avg 4000ms
Galaxy Tab 2.2 - avg 3900ms
Nexus S 2.3.2 - avg 5600ms

Tested With

TiSDK 1.6.1

Associated Helpdesk Ticket

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

Comments

  1. Varun Joshi 2012-05-16

    Tested this issue. The times were much better.
  2. Neeraj Gupta 2012-05-16

    A number of performance improvements in 1.8.0.1 and 2.0.1 releases have resolved this issue.
  3. Shyam Bhadauria 2012-08-29

    Working fine now with much lesser time difference - On iPhone 4S iOS 5.0.1 - Average time around 920ms On Samsung GALAXY Note Android 2.3.6 - Average time around 1300ms Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120828153312 Tested with Titanium  Studio: 2.1.2.201208201549 Device - iPhone 4S iOS 5.0.1,Samsung GALAXY Note Android 2.3.6 Machine OS - MAC 10.8

JSON Source