Megabit/Blazorise

Component Id generator performance

Closed this issue · 7 comments

This might be related => #22 .

Is there a possibility to opt out of element Id generation? It's not noticeable on small number of components, but on large number of generated components impact on performance is huge.

From my tests, rendering Fields / Form like component 500 times takes 12-13 seconds, vs 1-2 sec for just using plain bootstrap for same stuff. I'm guessing that's because you calculate and set new Id on some elements each time component is re-rendered.

I will have to benchmark Id generator but I don't think the problem is there.

The biggest slowdowns are actually fluent builders for column sizes and spacings. They're using Dictionary in the background and because it's regeneration itself on every refresh, it takes time. I already have those planned for optimization sometimes in the future but for now I'm more focused on components API.

After the final version of 0.6 is released I will start work on the optimizations for v0.7. Just wait a little longer if you don't actually need 500 components :)

Yep, much faster when i remove ColumnSize.
I don't. For now i'm just playing around ,trying to port some desktop client to blazor. I'll get more serious when they improve client debugging.

I was playing today to see how much speed I can gain with some code changes and I was able to speed class-generation by around 50-60%. There is definitely more room for improvements but that will wait a little longer.

PS. Blazor team is also working on some optimizations so that will also help in the future. See this presentation for more info

Can you test rendering performance in the new 0.6-preview6?

Will do on fri-sat.

It's still slow but then again i'm really pushing it with around 8 Child Components and then generating large number of Parent Components. Garbage Collector sweeps ~50 mb after each rendering.
Not a big issue atm, this can wait.

Is it still 12-13 seconds in your tests or is it any faster?
Anyways I'm going to wait until next version of Blazor to see how the performance optimizations will be.