1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    6
    Vote Rating
    1
    sf_cs is on a distinguished road

      0  

    Default Store performance

    Store performance


    Hi,

    we have a list which is connected to a store. We filled the store with data from a phonegap database like that:

    PHP Code:
    var store Ext.getStore('Storename');

    for (var 
    i=0i<data.lengthi++){
      var 
    modelObject = new Object();
      
    modelObject.var1data.asdf;
      
    modelObject.var2data.qwer;
      
    store.add(modelObject);

    With the above code we experienced very bad performance. We found out that each add rebuild the list. We got a much better performance with the following code

    PHP Code:
    var store Ext.getStore('Storename'),
          
    modelArray = new Array(),

    for (var 
    i=0i<data.lengthi++){
      var 
    modelObject = new Object();
      
    modelObject.var1data.asdf;
      
    modelObject.var2data.qwer;
      
    modelArray.push(modelObject);
    }
    store.add(modelArray); 
    Regards

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,965
    Vote Rating
    133
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Thank you for sharing.

Thread Participants: 1

Tags for this Thread