Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4457] Eliminate performance bottlenecks in creating views with properties

GitHub Issuen/a
TypeStory
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-28T09:52:40.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-25, Release 1.7.2
ComponentsiOS
Labelsperformance
ReporterReggie Seagraves
AssigneeReggie Seagraves
Created2011-06-20T08:55:00.000+0000
Updated2017-03-08T23:41:15.000+0000

Description

We have some evidence that creating views with properties are inordinately slow.

Comments

  1. Blain Hamon 2011-06-20

    For better testing, included is a minimal test harness:
       var startTime = Date.now();
       for(i=0;i<10000;i++)
       {
       var temp=Ti.UI.createView();
       }
       var endTime = Date.now();
       //Modify line 4 as needed. Because of the nature of javascript, you MUST
       //run each test as an independant launch; running tests sequentially will
       //unnecessairly burden the later tests with the memory cleanup for previous
       //tests.
       var delta = endTime - startTime;
       Ti.API.debug('our delta is '+delta);
       
  2. Blain Hamon 2011-06-21

    Test was done with 1000 iterations on an iPod 3, iOS 4.0.2. There was 5 tests each to get a peek at the std deviation. Each test was a separate launch of the application to remove memory issues as being a factor. * var temp=Ti.UI.createView(); ** 745, 714, 718, 715, 715 ** Mean: 721.4 SD: 13.2778 * var temp=Ti.UI.createView({left:10,top:50}); ** 1169, 1184, 1186, 1200, 1178 ** Mean: 1183.4 SD: 11.39298 * var temp=Ti.UI.createView({}); ** 912, 926, 923, 917, 909 ** Mean: 917.4, SD: 7.1624 * var temp=Ti.UI.createView(); var other = {left:10,top:50}; ** 709, 732, 730, 715, 717 ** Mean: 720.6 SD: 9.96494 * var other = {left:10,top:50}; ** 1 //Less than the margin of error; ignoring. * var temp = funct(); //With funct defined as Ti.UI.createView, to remove the lookup cost ** 557, 556, 562, 556, 562 ** Mean: 558.6 SD: 3.1305 * var temp = funct({left:10,top:50}); ** 1020, 1009, 1033, 1022, 1016 ** Mean: 1020 SD: 8.80341 * var temp = funct({}); ** 763, 760, 758, 761, 759 ** Mean: 760.2 SD: 1.92354 * var temp=Ti.UI.createView(); //funct was defined, but Ti.UI.createView was tested to determine if caching was significant. ** 719 //Deemed insignificant.
  3. Reggie Seagraves 2011-06-27

    Assisted QE with validation. Merged pull request.
  4. Stephen Tramer 2011-06-28

    Required to merge to 1.7.2.
  5. Stephen Tramer 2011-06-28

    Merged to 1.7.x
  6. Lee Morris 2017-03-08

    Closing ticket as fixed.

JSON Source