Performance Difference between client side jqgrid vs server side jqGrid

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 04:56:46

问题


I am working on an MVC project where I use jqGrid for ASP.NET MVC. However I am told by that the pure-jquery-client-side version (jqGrid) is better in performance. Is this true? To me they both seem to be doing the same stuff, just that the code is in different places- all the bulk work is still done using ajax. any advise would be appreciated.

EDIT- most places I use the grid has less than a 100 rows,page size 30,about 10-12 columns, mostly strings and dates. Only one page I use a grid with 500 rows but that will be used rarely.


回答1:


I don't think that you should rewrite your existing code, but I can agree that in case of usage less then 1000 rows of data the usage of loadonce: true is real alternative.

The design of jqGrid is oriented on server side sorting, paging and filtering/searching. So most users who start to use jqGrid in version less then 3.7 have already good implementation of backend. SQL Server with native code should be sure more quickly as JavaScript code were originally designed as interpreter language. On the other side current versions of web browsers contain quickly JavaScript engine. Every new version improve more and more performance of JavaScript.

It could be important for the user the total time of the paring, sorting or filtering operation. It includes the round trip time to the web server. One can better do exact measure in productive environment to compare performance of local grids with grids with pure remote datatype ("json" or "xml" without usage of loadonce). The rough rule which I use myself is:

  • if the number of rows under some 1000 rows I use loadonce: true and so client side paging, sorting and filtering of data
  • if the total number of rows larger as 10000 I use always server side paging, sorting and filtering

Your environment (network, Round trip time to the server and so on) could be other. So the edge when you should better user client side holding of data and when server side holding could be other. Nevertheless the usage of loadonce: true could be really very effective in the practice.

I personally don't use commertal version of jqGrid which you referenced. So I have to write backend side myself. In case of usage of loadonce: true the server code is very simple. It's easy to debug and to maintain.



来源:https://stackoverflow.com/questions/15814384/performance-difference-between-client-side-jqgrid-vs-server-side-jqgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!