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
While investigating support for larger datasets ( see) and transitioning from int to long, I identified several issues with the Virtualize component. Below are the findings and potential approaches to address them.
1M large datasets
Even before nearing the int.MaxValue threshold, the Virtualize component begins to exhibit issues with datasets around 1M items.
First you will notice the slider being in half, but it's only on 300k-th item (from 10M):
Second - when you scroll down (by dragging the scrollbar) it lose its marbles and show some "random"... It can get close to 1M, but not in a consistent way.
102d1427-c7c0-4b24-81ae-20d8e95bc595.mp4
This is not an issue with the Blazorise library but rather with browsers themselves. The Virtualize component works by using top and bottom "placeholder" elements, which have their height set to:
numberOfItemsToSkip * heightOfSingleItem
In this case, it results in:
height: 2.73663e+08px;
This value is far too large for browsers to handle, and as a result, they simply cut the content.
The maximum height for Chromium browsers is 16 million pixels, and for Firefox, it's 4 million pixels. This is why my example fails at around 1 million items, given that each item is approximately 20px in height.
While the issue on the aspnetcore repository was dismissed, I don't believe it's impossible to solve. The scrollbar looks identical whether your list contains 100k items or 10k items—just a small, draggable thumb.
For this reason, I think it is feasible to adapt the Virtualize component to handle much larger datasets. This could be achieved either at the component level or within the Blazorise library itself.
TotalItems is type of int, thus we cannot simply tell it to have more than that.
Solutions?:
Just simply mention that in docs "we cannot support large datasets with Virtualize, but it's not our fault"
Try to trick the Virtualize to think it's working on something smaller - I think doable, but rabbit holes ahead for sure. "The worst" scenario would be forking the Virtualize component... But from there it would be just a step to make support for int.MaxValue+ datasets - and that would be awesome...
Something else ??
The text was updated successfully, but these errors were encountered:
Just simply mention that in docs "we cannot support large datasets with Virtualize, but it's not our fault"
I would do just this. Mention that virtualize will break for >1M of data. It's a technical limitation that is not in our control, so people should understand it.
With long.MaxData, we want to be able to handle non-virtualize mode, which is still possible with regular pagination.
While investigating support for larger datasets ( see) and transitioning from
int
tolong
, I identified several issues with theVirtualize
component. Below are the findings and potential approaches to address them.1M large datasets
Even before nearing the
int.MaxValue
threshold, theVirtualize
component begins to exhibit issues with datasets around 1M items.First you will notice the slider being in half, but it's only on 300k-th item (from 10M):
![Image](https://private-user-images.githubusercontent.com/33880579/396174323-276d24b5-a4ee-49fd-bfbc-b506c3bc8aff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTEzNDgsIm5iZiI6MTczODkxMTA0OCwicGF0aCI6Ii8zMzg4MDU3OS8zOTYxNzQzMjMtMjc2ZDI0YjUtYTRlZS00OWZkLWJmYmMtYjUwNmMzYmM4YWZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA2NTA0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4MWJjNTkwYjZlYzJjMTRhNWRjMmJiNWZiMWM4ZDg2MWUxZjdhYmMxOTY3YjIxYzdjYTExNjJlMGE3MTQ0NjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wjqquLU4qNNy7kqisg86XBNhuQlRs3lI8cB_xGHWOfE)
Second - when you scroll down (by dragging the scrollbar) it lose its marbles and show some "random"... It can get close to 1M, but not in a consistent way.
102d1427-c7c0-4b24-81ae-20d8e95bc595.mp4
This is not an issue with the Blazorise library but rather with browsers themselves. The
Virtualize
component works by using top and bottom "placeholder" elements, which have their height set to:In this case, it results in:
This value is far too large for browsers to handle, and as a result, they simply cut the content.
It's actually reported in aspnetcore repo: dotnet/aspnetcore#26354
But explained in this answer on SO: https://stackoverflow.com/a/10884837/1154773
With nice too jsfiddle tool to verify the max pixels your browser can handle: https://jsfiddle.net/josh3736/BhHfN/
It is also mentioned in syncfusion's DataGrid docs: https://blazor.syncfusion.com/documentation/datagrid/virtual#limitations-for-virtualization (they don't support such large datasets in virtualized datagrid)
The maximum height for Chromium browsers is 16 million pixels, and for Firefox, it's 4 million pixels. This is why my example fails at around 1 million items, given that each item is approximately 20px in height.
While the issue on the
aspnetcore
repository was dismissed, I don't believe it's impossible to solve. The scrollbar looks identical whether your list contains 100k items or 10k items—just a small, draggable thumb.For this reason, I think it is feasible to adapt the
Virtualize
component to handle much larger datasets. This could be achieved either at the component level or within the Blazorise library itself.int.MaxValue + datasets
Here it hits another problem.
https://github.com/dotnet/aspnetcore/blob/1f0c1a87709a9b20a46df5c36f616950f0427ad1/src/Components/Web/src/Virtualization/ItemsProviderResult.cs#L20
ItemsProviderResult
which is used in:Blazorise/Source/Extensions/Blazorise.DataGrid/DataGrid.razor.cs
Line 2160 in f53c76f
TotalItems
is type of int, thus we cannot simply tell it to have more than that.Solutions?:
Virtualize
, but it's not our fault"Virtualize
to think it's working on something smaller - I think doable, but rabbit holes ahead for sure. "The worst" scenario would be forking theVirtualize
component... But from there it would be just a step to make support for int.MaxValue+ datasets - and that would be awesome...The text was updated successfully, but these errors were encountered: