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
Grid performance limits
29/10/2010
16:59
Avatar
benzocab
Member
Members
Forum Posts: 6
Member Since:
21/10/2010
sp_UserOfflineSmall Offline

I haven't found any documentation on scalability of the jqGrid. I ran some tests and it seems that 5000 + records on the grid make it unusable because of the very very slow response time. From what I saw the maximum number of rows is somewhere between 500 and 1000 rows, to keep the grid usable.

Does anyone have similar experience? Is this expected? Is there any optimization I can do to improve performance? I'm currently using ajax to load the grid from a Sql Server database. I would like to implement subgrids as well. We're looking to be able to load at least around 10k rows at a time. Paging is not an option because we want the user to be able to compare data using grouping and summary rows.

Thanks,

Ben

30/10/2010
01:34
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Ben,

I don't agree with you. You should post the code example which you used for tests (including HTML code and the included JavaScripts) and write which web browsers and in which versions you used. Do you used gridview:true parameter for example? Moreover in all realistic examples I see no sense to show the user 1000 or 10k rows at once. Moreover if you use SQL Server database you can implement grouping of data of the server side instead of doing it on the client side.

Regards
Oleg

01/11/2010
15:47
Avatar
benzocab
Member
Members
Forum Posts: 6
Member Since:
21/10/2010
sp_UserOfflineSmall Offline

Oleg,

I did not use the gridview=true parameter because the documentation says that it's not allowed when using subgrids which we'd like to use to show detail rows for each total. I can probably get around that, and will try to implement in the next day or two to see if this flag will make a difference.

As far as the loading all the data on the grid, yes, we can do the aggregation in the back end, but our back end is already doing some heavy processing, and the idea was to get a control that will handle the grouping and summation on its own will all the results there. We understand there's a limit, but my expectation was that the limit would be in the 10k range and not the 1k range.

Here is the JS code for my app:

-----------------------------------------------------

grid.jqGrid(
      {
        datatype: function(pdata) {
          GetGridData(pdata);
        },
        //        grouping: true,
        //        groupingView: {
        //          groupField: ['Agent'],
        //          groupColumnShow: [true],
        //          groupText: ['Blah [<b>{0}</b>]'],
        //          groupCollapse: false,
        //          groupOrder: ['asc'],
        //          groupSummary: [false],
        //          groupDataSorted: true
        //        },
        colNames: columns,
        colModel: colModel,
        rowNum: 10,
        rowList: [10, 25, 50, 100],
        pager: jQuery("#GridPager"),
        sortname: "Agent",
        viewrecords: true,
        width: 705,
        height: 'auto',
        cellEdit: false,
        gridComplete: function() {
          alert("grid completed loading.");
        },

        subGrid: true,
        subGridRowExpanded: function(subgrid_id, row_id) {
          // we pass two parameters
          // subgrid_id is a id of the div tag created whitin a table data
          // the id of this elemenet is a combination of the "sg_" + id of the row
          // the row_id is the id of the row
          // If we wan to pass additinal parameters to the url we can use
          // a method getRowData(row_id) - which returns associative array in type name-value
          // here we can easy construct the flowing
          var subgrid_table_id, pager_id;
          subgrid_table_id = subgrid_id + "_t";
          pager_id = "p_" + subgrid_table_id;
          _SubGridToLoad = subgrid_table_id;
          $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + pager_id + "' class='scroll'></div>");
          jQuery("#" + subgrid_table_id).jqGrid({
            //url:"subgrid.php?q=2&id="+row_id,
            //datatype: "xml",
            datatype: function(pdata) {
              GetSubGridData(pdata);
            },
            colNames: columns,
            colModel: colModel,
            rowNum: 20,
            pager: pager_id,
            sortname: 'num',
            sortorder: "asc",
            height: '100%'
          });
          jQuery("#" + subgrid_table_id).jqGrid('navGrid', "#" + pager_id, { edit: false, add: false, del: false })
        },
        subGridRowColapsed: function(subgrid_id, row_id) {
          // this function is called before removing the data
          //var subgrid_table_id;
          //subgrid_table_id = subgrid_id+"_t";
          //jQuery("#"+subgrid_table_id).remove();
        }

-----------------------------------------------------

GetGridData() and GetSubGridData() are Ajax calls that return the records from our middle layer. Everything up to that point is pretty fast. The performance issues I'm having are on the grid itself, when sorting, etc. I'll let you know what my results are with the "gridview=true" setting.

Thanks,

Ben

03/11/2010
21:42
Avatar
benzocab
Member
Members
Forum Posts: 6
Member Since:
21/10/2010
sp_UserOfflineSmall Offline

I did try "gridview=true" setting and it did seem speed up the grid, but not enough to make it usable for large amopunts of data. Not sure if anyone else has any other ideas.

04/11/2010
00:30
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

All the experiments just shows that you should do paging on the server side. I can not understand the argument "our back end is already doing some heavy processing". On the server side one implement all operations in compiled and optimized code, so you will have at least 1000 times better performance. Moreover the server can cache the results which can improve the performance also very much. With intelligent paging on the server side you will be without any problem be able to work with at least 100000 rows of data.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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