Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
improving performance of addJSONData
02/11/2014
21:39
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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.

03/11/2014
18:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

03/11/2014
18:40
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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! 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
47 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information