Forum


18:11

12/11/2010

I am building an ASP.Net MVC 2 application using jqGrid 3.8.2 to present some data I have stored in a DB. On my page I also have a Google map with a tiled overlay. I have noticed a significant worse performance in loading times of the map and the tile overlay in the application than what I have in other applications that does not use jqGrid. It would be natural with a slow-down if both jqgrid and the map were requesting data at the same time, but when I am zooming/panning the map there are no server requests run by the grid.
After doing some debugging in my code (adding/removing functionality bit by bit) I boiled it down to this: If I configure my jqgrid to use "datatype : local", it brings the performance back in the map!
Once I set "datatype: json" and "url : [myAspNetMvcController]" the loading of the map tiles takes a big hit.
My question is: Does anyone know why this happens? It seems that jqGrid is doing stuff continuously in the background even though it has not been asked to fetch any new data. I have breakpoints on the server, so I know that it does not fire requests. As I see it, it must be some jqgrid "magic" that causes the other javascript components on the page to run slowly, and hence causes the requests to be delayed.
It is very important for me to get to the bottom of this, and I really do not want to have to scrap jqGrid, since I really love it.
Will be thankful for all feedback that can point me in the right direction!
16:11

12/11/2010

Found the answer, and it turned out not to be jqgrid that was the bad guy, but the server-side Session store! I used Session as a cache for the grid data, because I needed the filtered data for other purposes than the grid, and wanted to avoid redundant trips to the DB. Once I wrote something to the Session object, the server took a hit and started handling all incoming requests slower (often several seconds!). I have later learned that using the Session object for caching is not advised in most cases, but I still don't know why it would cause nasty side-effects like this. If someone would enlighten me, that would be great! It cannot be an issue of taking up alot of RAM on the server, because the performance dropped just by writing
Session["test"] = "test";
Since I actually needed the data to be cached in a session scope, I solved the problem by instead using the HttpContext.Cache and a session-specific key.
Most Users Ever Online: 715
Currently Online:
61 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