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
Performance improvements for remapColumns
16/08/2011
17:24
Avatar
2late2die
Member
Members
Forum Posts: 7
Member Since:
11/07/2011
sp_UserOfflineSmall Offline

I've implemented some performance improvements to remapColumns function, but I couldn't do properly exhaustive testing, and I'm also not very deeply familiar with jqGrid. So what I'm saying is, these changes might negatively affect something I didn't think of, so if anyone has the inclination to do some further testing I'd appreciate it. Or even just take a look at the code and double check I'm not doing something stupid.

In any case, I've forked jqGrid on github and here are the changes to grid.base.js. They are fairly straitforward but here's a quick outline.

  • Put a check to make sure the remap is actually needed. remapColumns is called by columnChooser (and possibly other functions) with original order, so I run a quick loop and make sure to only proceed if there's been a change in the order of columns.
  • Replaced $.each loops in both resortArray and resortRows with for loops.
  • Changed rows selectors to use parent.find instead having parent as context (tiny improvement but also costs nothing).

The actual improvements in speed ended up being only about 10% (my data has 345 rows and 13 columns). However, the number of calls made was reduced almost five times. (I used firebug's console.profile to get these numbers)

16/08/2011
18:36
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

If you made some reset with ColumnChooser try to repeat the test after the simple fix described here. The fix is already in the github code.

16/08/2011
20:31
Avatar
2late2die
Member
Members
Forum Posts: 7
Member Since:
11/07/2011
sp_UserOfflineSmall Offline

Oh I already saw those and have them in my code, and they do improve the performance but they're different from my modifications above.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
32 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