daubman
9 Dec 2011, 12:33 PM
I have a fairly simple sorted Ext.grid.Panel that has a new row added to it every 5 seconds. After a minute or so Firefox (8.0.1) begins to slow down. Firebug's profiler shows that restoreScrollState is consuming ~50% CPU time. It is a low # of calls (once per row addition) however, each call takes ~250ms.
I am wondering:
1) Is this expected?
2) Is there anything I can do to improve this? I suppose I do not want the grid jumping around as data is added, but is there a more efficient way to add a new record to the grid's store (and subsequently display it in the grid)?
I am retrieving JSON from an Ext.data.Connection() (this becomes 'data' in the code example below) - this is run every 5 seconds retrieving a new JSON object in data each time.
...
data = Ext.decode(response.responseText);
...
sstStore.loadRawData(data, true);
lewStore.loadData(sstStore.getRange(), true);
Background:
sstStore is a store with a data-specific model for a specific data source that normalizes the data from this source. There will eventually be more sources that do the source-specific mapping of data to normalized/common format.
lewStore is the store that the grid panel uses. It is the place that all normalized data sources feed into so that all of the data may be viewed together from the disparate data sources.
I am wondering:
1) Is this expected?
2) Is there anything I can do to improve this? I suppose I do not want the grid jumping around as data is added, but is there a more efficient way to add a new record to the grid's store (and subsequently display it in the grid)?
I am retrieving JSON from an Ext.data.Connection() (this becomes 'data' in the code example below) - this is run every 5 seconds retrieving a new JSON object in data each time.
...
data = Ext.decode(response.responseText);
...
sstStore.loadRawData(data, true);
lewStore.loadData(sstStore.getRange(), true);
Background:
sstStore is a store with a data-specific model for a specific data source that normalizes the data from this source. There will eventually be more sources that do the source-specific mapping of data to normalized/common format.
lewStore is the store that the grid panel uses. It is the place that all normalized data sources feed into so that all of the data may be viewed together from the disparate data sources.