Results 1 to 5 of 5

Thread: How to increase performance of the Store

  1. #1

    Default How to increase performance of the Store

    I had a problem with Store, I loaded to my store (country store) more than 200 records from a json file, so when I push to view which contain country store, it took ~10 seconds to show the view. Please help me How does increase the performance ? and What is best way to show more than 100 records into a list?. Thank you very much.

    Here is my source code:

    Country Store
    :

    Code:
    Ext.define('MyApp.store.CountryStore', {
        extend: 'Ext.data.Store',
        config: {
            model: 'MyApp.model.Country',
            sorters:'country_name',
            proxy: {
                type: 'ajax',
                url : 'countries.json',
                reader: {
                    type: 'json',
                    rootProperty: 'countries'
                }
            }
        }
    });
    Country View:

    Code:
    Ext.define('MyApp.view.CountriesView', {
        extend: 'Ext.List',
        xtype:'countryList',
    
    
        config:{
            title:'Value Added Services',
            disableSelection:true,
            itemTpl: Ext.create(
                        'Ext.XTemplate',
    '<table width="100%">' +
                        '<tr>' +
    '<td align="left" width=90% class="text-header"><b>&nbsp {country_name}</b></></td>' +
                        '</tr>' +
                        '</table>'),
    //group the list
    //       grouped: true,
    //enable the indexBar
    //       indexBar: true,
           store: 'CountryStore',
           items: [
                {
                    docked: 'top',
                    xtype: 'searchfield',
                    placeHolder: 'Search...',
                    id:'searchFieldId'
                }
            ]
        }
    })

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    I personally, in 2.0.x, wouldn't have that many items in my store to render. In 2.1.0 we will be having an infinite list that will only show a portion of the list. Just right now it will render all 200 records which will not be a very good user experience for time to render and scrolling will likely be jumpy.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Location
    Aarhus, Denmark
    Posts
    67

    Default

    If I'm not much mistaken the proxies (or at least jsonp) actually include attributes for getting paginated results from the server. If it's an option that should greatly improve performance to only show for instance 25 items at a time and then move forward and back between them.

    That solution though have the disadvantage of forcing your users to be online all the time, whereas the other way you can load all upfront and use that for the case where the phone disconnects (which they do).

    Another strategy is way more complicated, but will be one I'll employ, using PhoneGap for my app, and then create a plugin that caches data on first load, enables updates of the data, when connected, and due to the use of a native database I'll make it do the abstraction of pagination when I need it.

    Last option though is a somewhat complicated thing to do, but I expect it to create a good performance for my users

  4. #4

    Default

    Quote Originally Posted by mitchellsimoens View Post
    I personally, in 2.0.x, wouldn't have that many items in my store to render. In 2.1.0 we will be having an infinite list that will only show a portion of the list. Just right now it will render all 200 records which will not be a very good user experience for time to render and scrolling will likely be jumpy.
    Thanks for your response. That 's a great news, I hope new version 2.1.0 will be release asap

  5. #5

    Default

    Quote Originally Posted by rohdef View Post
    If I'm not much mistaken the proxies (or at least jsonp) actually include attributes for getting paginated results from the server. If it's an option that should greatly improve performance to only show for instance 25 items at a time and then move forward and back between them.

    That solution though have the disadvantage of forcing your users to be online all the time, whereas the other way you can load all upfront and use that for the case where the phone disconnects (which they do).

    Another strategy is way more complicated, but will be one I'll employ, using PhoneGap for my app, and then create a plugin that caches data on first load, enables updates of the data, when connected, and due to the use of a native database I'll make it do the abstraction of pagination when I need it.

    Last option though is a somewhat complicated thing to do, but I expect it to create a good performance for my users
    Hi rohdef, It is a good idea, I will try it later. Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •