1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    23
    Vote Rating
    0
    luckyxx is on a distinguished road

      0  

    Default Improve performance: filtering some rows in grid from a xml file via xmlreader

    Improve performance: filtering some rows in grid from a xml file via xmlreader


    Code:
    store.reload({
       callback: function() {
          store.filterBy(function(record, id) {
             return (record.get('pageno') == 'abc');
          });
       }   
    });
    I use the above code for filtering some rows of record in grid from a xml file via xmlreader
    however, my xml file contains more than 10,000 records, it costs almost 10 seconds or even more than 15 seconds.

    What can I do for improving its searching time in xml for some particular fields?
    use caching? or special sorting(e.g. quick sort) or ... .?

    Pls kindly give me some advise

    Thanks in advance

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Surely it would be faster to filter your XML server side?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Jul 2008
    Posts
    23
    Vote Rating
    0
    luckyxx is on a distinguished road

      0  

    Default


    u means filtering it by server programming language first?
    like using ASP or PHP for extracting suitable data from database into xml first ?

    Quote Originally Posted by evant View Post
    Surely it would be faster to filter your XML server side?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Yes, I was under the assumption that your XML was being generated by something on a web server.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Ext User
    Join Date
    Jul 2008
    Posts
    23
    Vote Rating
    0
    luckyxx is on a distinguished road

      0  

    Default


    i see ~
    but this xml was not generated by me
    i'm not able to use ASP or other server side coding for control its size and number of records
    thus,
    would it be possible for me to change my Ext JS coding, in order to boost it up by different sorting or caching approaches?

    THZ


    Quote Originally Posted by evant View Post
    Yes, I was under the assumption that your XML was being generated by something on a web server.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Possibly, it depends how the rest of your code is working.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Ext User
    Join Date
    Jul 2008
    Posts
    23
    Vote Rating
    0
    luckyxx is on a distinguished road

      0  

    Default


    in fact, i'm testing the performance of my program like the following:

    Code:
    Ext.onReady(function(){
    
        // create the Data Store
        var store = new Ext.data.Store({
            // load using HTTP
            url: 'abc.xml',
    
            // the return will be XML, so lets set up a reader
            reader: new Ext.data.XmlReader({
                   // records will have an "Item" tag
                   record: 'Item',
                   id: 'ASIN',
                   totalRecords: '@total'
               }, [
                   // set up the fields mapping into the xml doc
                   // The first needs mapping, the others are very basic
                   {name: 'Author', mapping: 'ItemAttributes > Author'},
                   'Title', 'Manufacturer', 'pageno'
               ])
        });
    
        // create the grid
        var grid = new Ext.grid.GridPanel({
            store: store,
            columns: [
                {header: "Author", width: 120, dataIndex: 'Author', sortable: true},
                {header: "Title", width: 180, dataIndex: 'Title', sortable: true},
                {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
                {header: "Number of Page", width: 100, dataIndex: 'pageno', sortable: true}
            ],
            renderTo:'example-grid',
            width:540,
            height:200
        });
    
        store.load({
           callback: function() {
              store.filterBy(function(record, id) {
                 return (record.get('pageno') == '17');
              });
           }   
        });
    });

    Quote Originally Posted by evant View Post
    Possibly, it depends how the rest of your code is working.

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Not really.

    You might be able to speed up the comparison by making it an integer. Other than that, I don't see how you would make it much faster.

    It's the performance hit for having a static file.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  9. #9
    Ext User
    Join Date
    Jul 2008
    Posts
    23
    Vote Rating
    0
    luckyxx is on a distinguished road

      0  

    Default


    would it be possible for me to do "indexing" on my static file, in order to boost the filtering time in loading the grid?

    and Json file is faster than XML file?

  10. #10
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    1) It's an XML file, not a database, what do you mean by indexing?
    2) Yes, fairly significantly because it's native javascript.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi