PDA

View Full Version : The performance issue to create many stores in a page



sdd0
22 Aug 2014, 1:17 AM
For our web page's framework is limited to our device's framework, we must create many stores for one web page, I notice that the performance becomes bad after upgrading to 4.x.

as below, I have a loop to create stores I need.


for (var i = 0, length = cmd.length; i < length; i++) {


if (!Ext.isArray(cmd[i].id)) {
var ptr = showCLI[cmd[i].id][0];
var f = ptr.fields;
var sr = (ptr.subroot && response['zyshdata'+i].length != 0) ? ptr.subroot : '';


_zldAppGlobal.globals.startADDT = new Date().getTime();
store = Ext.create('Ext.data.Store', {
storeId: cmd[i].id,
fields: f,
data: response,
autoLoad: false,
groupField: '',
proxy: {
type: 'memory',
reader: {
root: 'zyshdata'+i+sr,
type: 'json',
successProperty: 'success'
}
},
listeners : {
load : function(store) {
count++;
}
}
});
_zldAppGlobal.globals.endADDT = new Date().getTime();
console.log('['+i+': eachReader create store]start time='
+ _zldAppGlobal.globals.startADDT + ' - endTime='
+ _zldAppGlobal.globals.endADDT + ' -> '
+ (_zldAppGlobal.globals.endADDT - _zldAppGlobal.globals.startADDT));
sum = sum + (_zldAppGlobal.globals.endADDT - _zldAppGlobal.globals.startADDT);


console.log('[eachReader sum] sum='+ sum);
eval(cmd[i].id+'=store;');

}
}


Take an example as the result, one of my pages needs 19 stores, finally, it takes 354 ms to be created, it's terrible! the strangest thing is, there is always one or two store takes more time than others, like no. 12, no. 13. Which store takes longer time is not fixed, it's random. Can anyone explain this situation? we have no this issue in the older version, Is there any better way to solve it?

Performance Result:


[0: create store]start time=1408697682304 - endTime=1408697682314 -> 10




[sum] sum=10




[1: create store]start time=1408697682317 - endTime=1408697682325 -> 8




[sum] sum=18




[2: create store]start time=1408697682328 - endTime=1408697682335 -> 7




[sum] sum=25




[3: create store]start time=1408697682338 - endTime=1408697682345 -> 7
[sum] sum=32






[4: create store]start time=1408697682348 - endTime=1408697682355 -> 7




[sum] sum=39




[5: create store]start time=1408697682357 - endTime=1408697682364 -> 7




[sum] sum=46




[6: create store]start time=1408697682367 - endTime=1408697682377 -> 10




[sum] sum=56




[7: create store]start time=1408697682380 - endTime=1408697682387 -> 7




[sum] sum=63




[8: create store]start time=1408697682390 - endTime=1408697682397 -> 7




[sum] sum=70




[9: create store]start time=1408697682400 - endTime=1408697682407 -> 7




[sum] sum=77




[10: create store]start time=1408697682409 - endTime=1408697682419 -> 10




[sum] sum=87




[11: create store]start time=1408697682422 - endTime=1408697682434 -> 12




[sum] sum=99




[12: create store]start time=1408697682436 - endTime=1408697682600 -> 164




[sum] sum=263




[13: create store]start time=1408697682605 - endTime=1408697682653 -> 48




[sum] sum=311




[14: create store]start time=1408697682659 - endTime=1408697682673 -> 14




[sum] sum=325




[15: create store]start time=1408697682676 - endTime=1408697682684 -> 8




[sum] sum=333




[16: create store]start time=1408697682684 - endTime=1408697682691 -> 7




[sum] sum=340




[17: create store]start time=1408697682692 - endTime=1408697682699 -> 7




[sum] sum=347




[18: create store]start time=1408697682700 - endTime=1408697682707 -> 7




[sum] sum=354

Gary Schlosberg
23 Aug 2014, 6:27 AM
In which specific version of ExtJS are you seeing this store performance issue? From which specific version are you upgrading?

sdd0
24 Aug 2014, 5:56 PM
I'm using ext-4.2.2.1144

sdd0
25 Aug 2014, 1:35 AM
Hi Gary,

I modified some code, I don't know why, the performance of creating store is back to normal. Please ignore this issue first, thank you for reply!

Gary Schlosberg
25 Aug 2014, 2:12 PM
Thanks for the follow-up. Post back if the issue reoccurs for you.

sdd0
26 Aug 2014, 1:50 AM
Hi Gary,
I found the performance depends on different browsers.
IE has better performance to create stores, the second is chrome, the worst one is Firefox, 19 stores take almost 300 ms to be created. Could you tell me what reason makes the difference between these browsers?

[IE] it's good, it only takes 42 ms to create 19 stores.


[0: create store]start time=1409045122220 - endTime=1409045122225 -> 5
[sum] sum=5
[1: create store]start time=1409045122225 - endTime=1409045122228 -> 3
[sum] sum=8
[2: create store]start time=1409045122229 - endTime=1409045122230 -> 1
[sum] sum=9
[3: create store]start time=1409045122231 - endTime=1409045122233 -> 2
[sum] sum=11
[4: create store]start time=1409045122234 - endTime=1409045122235 -> 1
[sum] sum=12
[5: create store]start time=1409045122236 - endTime=1409045122238 -> 2
[sum] sum=14
[6: create store]start time=1409045122239 - endTime=1409045122243 -> 4
[sum] sum=18
[7: create store]start time=1409045122244 - endTime=1409045122246 -> 2
[sum] sum=20
[8: create store]start time=1409045122247 - endTime=1409045122248 -> 1
[sum] sum=21
[9: create store]start time=1409045122250 - endTime=1409045122252 -> 2
[sum] sum=23
[10: create store]start time=1409045122252 - endTime=1409045122254 -> 2
[sum] sum=25
[11: create store]start time=1409045122255 - endTime=1409045122259 -> 4
[sum] sum=29
[12: create store]start time=1409045122262 - endTime=1409045122264 -> 2
[sum] sum=31
[13: create store]start time=1409045122265 - endTime=1409045122267 -> 2
[sum] sum=33
[14: create store]start time=1409045122267 - endTime=1409045122271 -> 4
[sum] sum=37
[15: create store]start time=1409045122274 - endTime=1409045122276 -> 2
[sum] sum=39
[16: create store]start time=1409045122276 - endTime=1409045122277 -> 1
[sum] sum=40
[17: create store]start time=1409045122279 - endTime=1409045122280 -> 1
[sum] sum=41
[18: create store]start time=1409045122282 - endTime=1409045122283 -> 1
[sum] sum=42


[Firefox] it takes 291 ms to create 19 stores, as I mentioned at the previous post, one or two stores randomly take more time than others(no.14 store bursts to 104 ms!?) to be created, the performance is really bad.


[0: create store]start time=1409045404189 - endTime=1409045404199 -> 10
[sum] sum=10
[1: create store]start time=1409045404202 - endTime=1409045404211 -> 9
[sum] sum=19
[2: create store]start time=1409045404214 - endTime=1409045404223 -> 9
[sum] sum=28
[3: create store]start time=1409045404226 - endTime=1409045404235 -> 9
[sum] sum=37
[4: create store]start time=1409045404258 - endTime=1409045404266 -> 8
[sum] sum=45
[5: create store]start time=1409045404269 - endTime=1409045404278 -> 9
[sum] sum=54
[6: create store]start time=1409045404280 - endTime=1409045404292 -> 12
[sum] sum=66
[7: create store]start time=1409045404294 - endTime=1409045404303 -> 9
[sum] sum=75
[8: create store]start time=1409045404305 - endTime=1409045404313 -> 8
[sum] sum=83
[9: create store]start time=1409045404316 - endTime=1409045404323 -> 7
[sum] sum=90
[10: create store]start time=1409045404326 - endTime=1409045404336 -> 10
[sum] sum=100
[11: create store]start time=1409045404340 - endTime=1409045404352 -> 12
[sum] sum=112
[12: create store]start time=1409045404355 - endTime=1409045404363 -> 8
[sum] sum=120
[13: create store]start time=1409045404366 - endTime=1409045404372 -> 6
[sum] sum=126
[14: create store]start time=1409045404375 - endTime=1409045404479 -> 104
[sum] sum=230
[15: create store]start time=1409045404486 - endTime=1409045404526 -> 40
[sum] sum=270
[16: create store]start time=1409045404527 - endTime=1409045404535 -> 8
[sum] sum=278
[17: create store]start time=1409045404536 - endTime=1409045404543 -> 7
[sum] sum=285
[18: create store]start time=1409045404544 - endTime=1409045404550 -> 6
[sum] sum=291


[Chrome] it takes 76 ms to create 19 stores, the performance is worse than IE.


[0: create store]start time=1409045937936 - endTime=1409045937943 -> 7
[sum] sum=7 retrieveData.js?_dc=1409045854304:121
[1: create store]start time=1409045937944 - endTime=1409045937945 -> 1
[sum] sum=8 retrieveData.js?_dc=1409045854304:121
[2: create store]start time=1409045937945 - endTime=1409045937948 -> 3
[sum] sum=11 retrieveData.js?_dc=1409045854304:121
[3: create store]start time=1409045937949 - endTime=1409045937952 -> 3
[sum] sum=14 retrieveData.js?_dc=1409045854304:121
[4: create store]start time=1409045937953 - endTime=1409045937955 -> 2
[sum] sum=16 retrieveData.js?_dc=1409045854304:121
[5: create store]start time=1409045937956 - endTime=1409045937958 -> 2
[sum] sum=18 retrieveData.js?_dc=1409045854304:121
[6: create store]start time=1409045937961 - endTime=1409045937991 -> 30
[sum] sum=48 retrieveData.js?_dc=1409045854304:121
[7: create store]start time=1409045937998 - endTime=1409045938003 -> 5
[sum] sum=53 retrieveData.js?_dc=1409045854304:121
[8: create store]start time=1409045938004 - endTime=1409045938008 -> 4
[sum] sum=57 retrieveData.js?_dc=1409045854304:121
[9: create store]start time=1409045938009 - endTime=1409045938011 -> 2
[sum] sum=59 retrieveData.js?_dc=1409045854304:121
[10: create store]start time=1409045938011 - endTime=1409045938012 -> 1
[sum] sum=60 retrieveData.js?_dc=1409045854304:121
[11: create store]start time=1409045938013 - endTime=1409045938017 -> 4
[sum] sum=64 retrieveData.js?_dc=1409045854304:121
[12: create store]start time=1409045938018 - endTime=1409045938019 -> 1
[sum] sum=65 retrieveData.js?_dc=1409045854304:121
[13: create store]start time=1409045938020 - endTime=1409045938021 -> 1
[sum] sum=66 retrieveData.js?_dc=1409045854304:121
[14: create store]start time=1409045938022 - endTime=1409045938026 -> 4
[sum] sum=70 retrieveData.js?_dc=1409045854304:121
[15: create store]start time=1409045938028 - endTime=1409045938030 -> 2
[sum] sum=72 retrieveData.js?_dc=1409045854304:121
[16: create store]start time=1409045938032 - endTime=1409045938033 -> 1
[sum] sum=73 retrieveData.js?_dc=1409045854304:121
[17: create store]start time=1409045938033 - endTime=1409045938034 -> 1
[sum] sum=74 retrieveData.js?_dc=1409045854304:121
[18: create store]start time=1409045938036 - endTime=1409045938038 -> 2
[sum] sum=76

Richardmansfield
26 Aug 2014, 3:02 AM
Hi! I am a newbie to this forum. A week before my friend told me that in Joomla website and all plugins/ extensions are installed to improve the performance/speed of the website. Whether in snecha website also is there any plugin available to increase the performance/speed of the website if so please share with me as it will be very helpful for me to the new website which i am going to start designing soon.