Titanium JIRA Archive
Appcelerator Community (AC)

[AC-901] iOS: SearchBar activating is dramatically slow for large ListView

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-15T04:40:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, listview, searchbar
ReporterFar
AssigneeShak Hossain
Created2014-08-25T18:31:05.000+0000
Updated2016-03-08T07:37:12.000+0000

Description

Deactivating is also very slow. Look at time profiler screenshots for list with ~200 items. First is for activating, second is for deactivating.

Attachments

FileDateSize
Screen Shot 2014-08-25 at 9.24.29 PM.png2014-08-25T18:31:05.000+0000111968
Screen Shot 2014-08-25 at 9.25.03 PM.png2014-08-25T18:31:05.000+000088311

Comments

  1. Mauro Parra-Miranda 2014-08-25

    Hello, can you please provide a testcase in the form of app.js? Thanks! Best Regards, Mauro
  2. Far 2014-08-26

    We need custom slow ListView template. Look like all items in ListView reloaded if SearchBar activated.
       var section = Ti.UI.createListSection();
       
       var template = {
           childTemplates: [{
               type: 'Ti.UI.ImageView',
               properties: {layout: 'horizontal'},
               childTemplates: []
           }]
       };
       for (var i = 0; i < 10; i++) {
           template.childTemplates[0].childTemplates.push({
               type: 'Ti.UI.ImageView',
               bindId: 'image' + i
           });
       }
       
       var items = [];
       for (i = 0; i < 10000; i++) {
           var images = {};
           for (var j = 0; j < 10; j++) {
               images['image' + j] = {
                   image: 'appicon.png',
                   width: '10%'
               };
           }
           items.push(images);
       }
       section.setItems(items);
       
       var list = Ti.UI.createListView({
           top: 20,
           searchView: Ti.UI.createSearchBar(),
           templates: {'template': template},
           defaultItemTemplate: 'template'
       });
       list.appendSection(section);
       
       var win = Ti.UI.createWindow();
       win.add(list);
       win.open();
       
  3. Mostafizur Rahman 2014-09-06

    Hello, We have tested this issue with the above testing code. We don't find any change in large ListView performance for the above code. *TESTING ENVIRONMENT:* Titanium SDK: 3.3.0.GA and 3.2.3.GA Titanium CLI: 3.3.0 OS X Version: 10.9.3 iOS Simulator: 7.1 Thanks.
  4. Far 2015-02-03

    Of cos on simulator performance will be fine. I meant *REAL* devices. In my app I have list view with 200 items and simple custom template (two labels). Activating search view takes 2500ms on iPod touch 5.
  5. Amimul Hossain 2015-02-04

    Hello, We have tested this issue with SDK 3.5.1 and highers in iOS 8.1.3 devices. It's working smoothly.

    TESTING ENVIRONMENT

    CLI version 3.4.1, Titanium SDK version 3.5.0.GA iOS 8.1.3, Device iPod 5G

    CODE SAMPLE

       var section = Ti.UI.createListSection();
        
       var template = {
           childTemplates: [{
               type: 'Ti.UI.ImageView',
               properties: {layout: 'horizontal'},
               childTemplates: []
           }]
       };
       for (var i = 0; i < 10; i++) {
           template.childTemplates[0].childTemplates.push({
               type: 'Ti.UI.ImageView',
               bindId: 'image' + i
           });
       }
        
       var items = [];
       for (i = 0; i < 10000; i++) {
           var images = {};
           for (var j = 0; j < 10; j++) {
               images['image' + j] = {
                   image: 'appicon.png',
                   width: '10%'
               };
           }
           items.push(images);
       }
       section.setItems(items);
        
       var list = Ti.UI.createListView({
           top: 15,
           searchView: Ti.UI.createSearchBar(),
           templates: {'template': template},
           defaultItemTemplate: 'template'
       });
       list.appendSection(section);
        
       var win = Ti.UI.createWindow();
       win.add(list);
       win.open();
       

    STEP TO REPRODUCE

    1. Create a new project. 2. Copy the code above to project "app.js" file. 3. Run the project in a iOS device. 4. After the app opens, tap on searchbar to search.

    OBSERVED RESULT

    Though It' takes time to actually open the app, after the app opens tapping on SearchBar to activate is working smoothly, approximately 1500ms~1600ms. it's can't be consider as "dramatically slow" considering the large listView. Also deactivating the SearchBar is much faster then activating. It's not a valid bug.

JSON Source