Unplanned
Last Updated: 15 Mar 2019 06:19 by ADMIN
Erik
Created on: 12 Mar 2019 09:57
Category: Kendo UI for jQuery
Type: Bug Report
1
Grid with virtualization requests exact same data from server multiple times after each other with normal scrolling

In a grid with virtualization, when just normally scrolling down requests for the exact same data are often sent multiple times after each other. The reason for this is probably that the grid sends an asynchronous request for example Top 100, Skip 200 and then does not keep track of that it is still waiting for a reply for this request, before asking for the same data a short period later. 

Commonly requests for the same data is made 2 or 3 or more times after each other, causing performance problem at the server side and in many cases unnecessary calls to the database. Fixing this should lower the number of requests for data to the server considerably, maybe with a factor two or more with just normal grid operation when the user is just scrolling down to view more data in the grid.  

To demonstrate the problem, open a copy of the virtualization grid demo, for example here:

https://dojo.telerik.com/iXijoyaY

Open the Developer Tools and just observe which network requests are sent to the server. Just scroll down in any way and observe that very often the exact same request is made. A request for the same data has the same Top and Skip values in the parameters sent the server. You can see the servers reply is exactly the same JSON data multiple times after each other.

Solving this performance problem almost completely would seemingly be to in a variable just keep track of the "Latest request" sent, since the problem happens mostly just with normal scrolling in one direction with request sent after each other. So one would need to keep track of that a call for Top 100, Skip 200 has been made, and if the program wants to request the exact same data again, just wait for a reply for the first request, instead of sending a new one. (If needed, send a new request only after a specific timeout for a reply for the first one).

A more thorough solution would be to have a data structure to keep track of the Top and Skip tuples for all the calls to the server that has not yet have had a reply from the server, and not repeat those exact same calls again if still waiting for a reply for the first request.

1 comment
ADMIN
Stamo Gochev
Posted on: 15 Mar 2019 06:19
Hi,

Thanks for sending this suggestion. A certain mechanism for tracking the sent requests depending on their parameters can be researched in order to introduce some kind of an optimization. This should take into account the mixture of prefetch and fetch requests that might happen if scrolling is happening too fast and also that the data on the server might have changed during requests with the same parameters in the overall process.

Regards,
Stamo Gochev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.