Blazored / Typeahead

Typeahead control for Blazor applications
https://blazored.github.io/Typeahead/
MIT License
424 stars 102 forks source link

Improve performance with virtualization #36

Open vertonghenb opened 4 years ago

vertonghenb commented 4 years ago

If you have a big list of items the rendering can slow down the component. To tackle this performance hit, we could use the idea of virtualization where we only render de SelectItems which are being shown.

A package that does this is the following: https://samprof.github.io/BlazorVirtualScrolling/ However we could also roll our own, so I'm looking for some feedback on this one.

chrissainty commented 4 years ago

I definitely think this is worth investigating, at the very least. I've not tried virtualisation before, but I've read through the samprof repo a long time ago, when he first released it and it looked good. Might be the best starting point?

vertonghenb commented 4 years ago

Personally I'm not fond of using the package since it also requires some .js or .css files. However, we could package them with ours and use the same idea EmbeddedBlazorContent they use in that package.

app.UseEmbeddedBlazorContent(typeof(BlazorVirtualScrolling.VirtualScroll).Assembly);
@using EmbeddedBlazorContent
<head>
    ...
    @Html.EmbeddedBlazorContent()
</head>

However this is quite harsh in my opinion and I think we'd be better off rolling our own system.

chrissainty commented 4 years ago

I'm certainly up for rolling our own. I'd prefer not to take a dependency where we don't absolutely have to.

vertonghenb commented 4 years ago

Recheck if an Array<T> is still the way to go, initially we didn't use .Count() that much, maybe swap it for a Dictionary or List check #78

vertonghenb commented 3 years ago

Also coming in .NET 5 (Virtualize Component)

JohnKiller commented 3 years ago

@vertonghenb where did you find that information? I really hope some kind of virtualization is supported natively in Blazor, but I didn't find any GitHub issue documenting the progress on this

vertonghenb commented 3 years ago

@vertonghenb where did you find that information? I really hope some kind of virtualization is supported natively in Blazor, but I didn't find any GitHub issue documenting the progress on this

In one of the asp.net live community stand-ups.

esamk commented 3 years ago

@JohnKiller

Daniel Roth (of MS) replied a question about virtualization in asp.net blog:

"We’ve added a Virtualize component to help with handling virtualization in .NET 5 RC1, which should be available in a couple of weeks.. You can try out a .NET 5 RC1 build from https://github.com/dotnet/installer."

That was 31. August, so I guess we don't have to wait too long...

rybkov commented 2 years ago

Any updates?

chrissainty commented 2 years ago

@rybkov Are you experiencing performance issue with the component?

rybkov commented 2 years ago

@chrissainty I would say not with the component specifically, but with any component that has to render lots of items. I found that 100 suggestions is not so bad, but anything after feels the delay in the rendering. Business requirements is to show lots of data and would be nice to have virtual scroll in place.