-
Notifications
You must be signed in to change notification settings - Fork 2
Description
With chunking and lazy loading of data, now that we scroll very fast to the end of the file, many requests are fired and the extension crashes or freeze. This is especially true for large files, but also for smaller ones that could load all at once before.
Once thing we could do is implement the preloading factor mentioned in #12 to reduce the number of requests.
Thought that is unlikely to really fix the issue.
The most likely thing we need to do is throttle requests in some way.
There is a Throttler in lumino Polling package.
We could throttle request (with "trailing" mode) in the DataModel, though it is unclear in what state that would leave the grid.
If we drop requests, but we did no still had to reply a representation for the cell (because of lack of async), so this one is never updated.
This may not be a problem because it does not seem like the DataGrid keeps a cache of anything already rendered, so new data should be fetched next time we want to view it.
One issue though is in the event that we drop the request for the current viewport. Then we have currently no way to know that the request is dropped and the data invalid.
Ideally we want to throttle the DataGrid drawing method so that no data is lost.
https://github.com/jupyterlab/lumino/blob/17321dd0210371c376a3d60efce743e9742524be/packages/datagrid/src/datagrid.ts#L5009
I am unsure if this all make sense without the function being async.