Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-10363

Android: Picker "add" method is dead slow

    Details

      Description

      The problem

      Picker's "add" method is very slow, when creating picker with 30 rows on tablet with Tegra2 processor, picker "add" method takes about 1.5 seconds to execute.

      This greatly impacts Titanium's performance when there are more pickers with more that just a few options.

      Test case

      (function() {
         
         var win = Ti.UI.createWindow({
         		backgroundColor: '#000'
         });
         
         var data = [];
         
         var start = new Date();
         
         for (var i = 0; i < 30; ++i) {
         		data[i] = Ti.UI.createPickerRow({ title: 'Row ' + i });
         }
         
          Ti.API.info('Rows: ' + (new Date() - start));
         
         var picker = Ti.UI.createPicker();
         
         start = new Date();
         
         picker.add(data);
         
         Ti.API.info('Finished: ' + (new Date() - start));
         
         win.add(picker);
         
         win.open();
         
      })();
      

      30 rows is really not big number, especially on powerful hardware. 1.5 seconds is a way too much. JS execution time (creation of array of picker's rows) is 14ms. Execution of "add" method should be similar to that value.

        Attachments

          Activity

            People

            • Assignee:
              krowley Karl Rowley
              Reporter:
              ivan.skugor Ivan Skugor
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code