You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The clearSearch function appears to send multiple copies of the data table to the client. Here's a reproducible example. To see the issue, open up the inspector in your browser, go to the "Network" tab, and then click on the "clear search" button. You'll see all the requests come through. If you look at the responses, you'll notice that they are all identical (except for the "draw" property, which increments after each request).
The number of requests is equal to the number of columns plus one - my guess is one for each column plus the global search? This means that the more columns there are, the more duplicate copies there are. While in this case it doesn't cause much noticeable lag, it becomes an issue for very large datatables with lots of columns.
This issue also interacts with another issue: #504. That issue explains how the JSON object includes a vector that contains one element for each row, which makes the requests unnecessarily large for very large data tables. In my use case, the data table has over 870,000 rows and 32 columns. Each response ends up being 1.9MB because of the row numbers that are included in the JSON responses, and then this request is repeated 32 times, which means we're transferring a lot of unnecessary data every time the search is cleared.
I've done a bit of digging through the code, and this is the JavaScript code that's updating the search:
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('DT'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/DT').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered:
The
clearSearch
function appears to send multiple copies of the data table to the client. Here's a reproducible example. To see the issue, open up the inspector in your browser, go to the "Network" tab, and then click on the "clear search" button. You'll see all the requests come through. If you look at the responses, you'll notice that they are all identical (except for the "draw" property, which increments after each request).The number of requests is equal to the number of columns plus one - my guess is one for each column plus the global search? This means that the more columns there are, the more duplicate copies there are. While in this case it doesn't cause much noticeable lag, it becomes an issue for very large datatables with lots of columns.
This issue also interacts with another issue: #504. That issue explains how the JSON object includes a vector that contains one element for each row, which makes the requests unnecessarily large for very large data tables. In my use case, the data table has over 870,000 rows and 32 columns. Each response ends up being 1.9MB because of the row numbers that are included in the JSON responses, and then this request is repeated 32 times, which means we're transferring a lot of unnecessary data every time the search is cleared.
I've done a bit of digging through the code, and this is the JavaScript code that's updating the search:
https://github.com/rstudio/DT/blob/4e63a4664d9caa9fb9d4fb17061ce5eab94bec18/inst/htmlwidgets/datatables.js#L1412C1-L1429C6
I'm assuming the problem lies in here somewhere?
Session info
By filing an issue to this repo, I promise that
xfun::session_info('DT')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/DT')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: