[CLOSED] Performance. Live row add

  1. #1

    [CLOSED] Performance. Live row add

    I am facing performance issue if I want to add data in store in specific time intervals .For example
     lateBind: function (data) {
            var rec = 0;
            var grdStore = Ext.getStore('storeLiveSetData');
            console.log('late binding');
            bindIntervalId = window.setInterval(function () {
                if (rec < data.length) {
                    grdStore.add(data[rec]);
                    Ext.getCmp('sbSearchResult').setText('Records : ' + grdStore.data.length);
                } else {
                    window.clearInterval(bindIntervalId);
                }
                rec++;
            }, 250);
        }
    The problem starts after 80th records is being added to the Grid and eventually interface becomes unresponsive. Interesting thing is that rows are added 20 per server request so there is time between request
    Last edited by Daniil; Oct 07, 2014 at 6:44 AM. Reason: [CLOSED]
  2. #2
    Hi @odyssey,

    I guess there is a possibility that
    window.clearInterval(bindIntervalId);
    doesn't clear the intervals, because of the fact that the bindIntervalId variable is a global one.
  3. #3
    Well I wish that was the problem . I edited code for simplification.Actually bindIntervalId is mssoc.live_search.fn.bindIntervalId
     lateBind: function (data) {
            if (data.length == 0) { return; }
            var rec = 0;
            var grdStore = Ext.getStore('storeLiveSetData');
            console.log('late binding');
            var arr = []; // tried to put in array before adding to store
            mssoc.live_search.fn.bindIntervalId = window.setInterval(function () {
                if (rec < data.length) {
                    arr.push(data[rec]);// here it did not help
                    grdStore.add(arr);
                    grdStore.sort('coldatetime', 'desc'); 
                    Ext.getCmp('sbSearchResult').setText('Records : ' + grdStore.data.length);
                } else {
                    window.clearInterval(mssoc.live_search.fn.bindIntervalId);
                    arr = [];
                    mssoc.live_search.fn.bindChart();
                    grdStore.commitChanges(); //nor this helped
               }
                rec++;
            }, 250);
        }
    Here I even tried commitChanged and before adding to store I am pushing it to array but it did not help.
  4. #4
    Well, it is difficult to say anything concrete without a full test case to reproduce the problem.

Similar Threads

  1. Live search
    By Vaishali in forum 1.x Help
    Replies: 3
    Last Post: Apr 03, 2012, 6:31 AM
  2. Live search
    By Yannis in forum 1.x Help
    Replies: 3
    Last Post: Jan 14, 2010, 1:22 AM
  3. Combobox live search
    By Yannis in forum 1.x Help
    Replies: 0
    Last Post: Dec 09, 2009, 11:19 AM
  4. live search
    By olimpia in forum 1.x Help
    Replies: 0
    Last Post: Jun 29, 2009, 6:44 PM
  5. "Live Search" sql example
    By jmilton in forum 1.x Help
    Replies: 4
    Last Post: Apr 06, 2009, 1:14 PM

Tags for this Thread

Posting Permissions