Forum
21:39
10/08/2009
Hello Tony,
the analyse of performance of jqGrid with large number of rows have shown that there are two most expensive lines: the lineÂ
$("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(''));
where the grid body will be placed to the HTML page and the lineÂ
if(!ts.p.treeGrid && !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0;}
 where will be made unneeded work because the value of ts.grid.bDiv.scrollTop seems be always 0 in the if condition (because of calling emptyRows in the line).
I suggest first replace the line $("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join('')); to the following
ts.firstElementChild.innerHTML += rowData.join('');
The demo demonstrates the performance of original jqGrid with 1000 rows per page from 90000 total rows and the same demo with the fixed code seems to works quickly in all browsers where I tested it. The most benefit I could see in Internet explorer, but other web browser shown different coefficient of advantage by different number of visible rows, nevertheless the suggested modification seems to work always more quickly.
Best regards
Oleg
P.S. One can do the same modification in the code of addXmlData.
18:08
Moderators
30/10/2007
Hello Oleg,
Â
Thanks. We should apply this with care.
As far as I remember (maybe I'm wrong) there was a problem with the memory when using this approach.
Instead I will try to make more deeper investigation.
I'm little busy these days, but will made the needed.
Thank you again.
Kind 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.
18:40
10/08/2009
Hello Tony,
I expect possible memory leeks problems more in deleting of existing rows (in emptyRows), but placing replacing the table body with new content, where the only existing row is the first one, (at least in case of scroll:false) seems me safe. It's strange, but setting of ts.grid.bDiv.scrollTop to 0 (even it the old value is already 0) take really a lot of time. I could not find any case when the setting is needed. Probably you can remind you better about such cases or just the condition in "if" is wrong.
In any way it's good to test the suggested modification.
Best regards
Oleg
P.S. Please don't forget about the pull request and about the post when you find time for it. We wait for new release of jqGrid too. Best wishes!Â
Most Users Ever Online: 715
Currently Online:
40 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