Forum
10:06
10/08/2009
Hello Tony,
during writing the answer on the stackoverflow I found out that the line
var p = $.extend(true,{ // there are here different default values of jqGrid parameters }, $.jgrid.defaults, pin ||{});
of jqGrid code is the bottleneck during loading of large number of local data. The demo demonstrates the problem. It creates jqGrid with 90,000 rows of data entered directly using data: gridData input parameter. If one don't specify sortname input parameter then jqGrid displays unsorted data.
The problem is that deep version (with true as the first parameter) of $.extend works very slowly with arrays. Especially slowly works $.extend in Internet Explorer. To improve performance one can either use non-deep $.extend (but one can have some compatibility issues) or just temporary remove data parameter from the list of input parameters and include it back after the call of $.extend:
var localData; if (pin != null && pin.data !== undefined) { localData = pin.data; pin.data = []; } var p = $.extend(true,{ // there are here different default values of jqGrid parameters }, $.jgrid.defaults, pin ||{}); if (localData !== undefined) { p.data = localData; }
The demo uses jqGrid code fixed in the described above way and it works much quickly especially in Internet Explorer. I suggest to fix the main code of jqGrid in the way. I didn't posted the above changes as new pull request only because there are exist another pending pull request which I posted before.
Best regards
Oleg
11:12
Moderators
30/10/2007
Hello Oleg,
Thanks for this investigation and examples (as usual )
I think that this is rather problem of jqQuery and not of jqGrid.
I'm following the philosophy, that the problems should be resolved at its origin.
Â
I have tested your both examples (slow and fast ) in IE11 and have a impression that there is no diffrenece.
Do you have any measurements? I will try measure both examples and see if there are a big difference I will accept eventually this request.
Â
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
14:51
10/08/2009
I modified the demo: the original and "the improved". Different web browsers shows different time, for example
IE11: original about 830, improved about 160,Â
IE10: original about 600, improved about 120,
Chrome 37.0.2062.103: original about 1050, improved about 130
In all tests the "improved" version worked noticeably quickly.
About your comment rather the problem is jQuery problem or jqGrid problem. I see the problem so. If jqGrid are used with data input parameter it's not really required to make deep copy of it. My demos shows, that making deep copy of a array parameter could take relatively many time. The only parameter which can be really large is data parameter. If jqGrid will don't use it in $.extend(true,{...}) then the code could be just more quickly. So I see the suggested change as performance optimization in jqGrid and not as workaround of some jQuery bug. One can suggest a lot of optimizations in jqGrid code, but the most from there will improve performance in less then 0,1%. What I suggest can improve loading of large grid in multiple times just by removing some operation (deep copy of data parameter) which are not really required for jqGrid.
Best regards
Oleg
P.S. I posted the pull request with the suggestions.
12:29
Moderators
30/10/2007
Hello Oleg,
Â
I have performed my tests and would say - incredible improvement.
My tests actually are measuring only the extend in order to isolate the fix.
You know that I'm very sensitive when we speak about performance.
Just to tell you - with your data in FireFox (only extend)
Â
Original 7650Â - improved - 1.
Since I can not believed on this I have made this several time with diffrent data, but the result was the same.
Â
BIG THANKS.
Â
Best Regards
Tony
Â
P.S. Just merged the request.
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
35 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66