PDA

View Full Version : load time increases progressively



faireu
29 Jan 2014, 9:01 AM
Sorry for my English first.

I'm a newbye and I'm working on a dynamic grid, designed with Architect (3.0.2.1375) that should load fields (columns) and data (rows) from a json file.

I set up a store and a model in Architect and bound the click event of a button to the following :

var grid = Ext.getCmp('myGrid');
var store = Ext.getStore('TestsStore2');
//store.removeAll(true);
store.on("metachange", metaChanged2);
function metaChanged2(store, meta) {
grid.reconfigure(store, meta.columns);
}
store.load();

Everything works just fine, when I click the button the grid is populated with the correct data (just a few sample rows).

The only problem I'm facing is that performances decrease (load time increase) at every new click.

The first click takes just a few milliseconds to fill the grid but if I click again and again the time increases up to a second or more (every time a few tenth of a second).

The "store.removeAll()" call does not change the behavior.

If I refresh the page in the browser the whole process starts again : first click fast then slows down.

Any suggestion ?

Thanks.

-----------------

Sample json file (taken from a post I found on the net.)

{
"success": true,
"msg": "",
"metaData": {
"fields": [
{
"name": "poller"
},
{
"name": "poll_date"
},
{
"name": "PING",
"type": "int"
},
{
"name": "SNMP",
"type": "int"
},
{
"name": "TELNET",
"type": "int"
},
{
"name": "SSH",
"type": "int"
},
{
"name": "all_passed"
}
],
"columns": [
{
"dataIndex": "poller",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "Poller"
},
{
"dataIndex": "poll_date",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "Poll Date"
},
{
"dataIndex": "PING",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "PING",
"renderer": "RenderFailedTests"
},
{
"dataIndex": "SNMP",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "SNMP",
"renderer": "RenderFailedTests"
},
{
"dataIndex": "TELNET",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "TELNET",
"renderer": "RenderFailedTests"
},
{
"dataIndex": "SSH",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "SSH",
"renderer": "RenderFailedTests"
},
{
"dataIndex": "all_passed",
"flex": 1,
"sortable": false,
"hideable": false,
"text": "All Passed",
"renderer": "RenderFailedTests"
}
]
},
"tests": [
{
"poller": "CHI",
"poll_date": "2013-03-06",
"PING": "1",
"SNMP": "0",
"TELNET": "1",
"SSH": "0",
"all_passed": "0"
},
{
"poller": "DAL",
"poll_date": "2013-03-06",
"PING": "2",
"SNMP": "4",
"TELNET": "1",
"SSH": "1",
"all_passed": "0"
},
{
"poller": "CHI",
"poll_date": "2013-03-04",
"PING": "3",
"SNMP": "5",
"TELNET": "1",
"SSH": "0",
"all_passed": "0"
},
{
"poller": "DAL",
"poll_date": "2013-03-04",
"PING": "1",
"SNMP": "0",
"TELNET": "1",
"SSH": "0",
"all_passed": "0"
},
{
"poller": "CHI",
"poll_date": "2013-03-01",
"PING": "1",
"SNMP": "0",
"TELNET": "1",
"SSH": "0",
"all_passed": "0"
}
]
}

mitchellsimoens
6 Feb 2014, 12:02 PM
You may have a memory leak somewhere but each time you return the meta you are creating a new Model class but that shouldn't increase the load time that much.