Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[blazor] HtmlRenderer is slow #22405

Closed
Lupusa87 opened this issue Jun 1, 2020 · 5 comments
Closed

[blazor] HtmlRenderer is slow #22405

Lupusa87 opened this issue Jun 1, 2020 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.

Comments

@Lupusa87
Copy link
Contributor

Lupusa87 commented Jun 1, 2020

htmlrenderer is now working too slow when there is bit complex and large renderfragment or component.

I know it is going to change, just wanted to report that htmlRenderer, RenderFragment frames and all this model seems bit overheat and causes long processing times.

htmlRenderer produces too long tokens list and is doing lot of work to get right html result.

I think there can be simpler, lightweight solution, do not get me wrong but this part really needs good refactoring.

one option: If we let developer provide more data when building render tree, converting it to html can be much faster

or to let dev write html along with building tree, there won't be any need to generate html from frames, just it will be ready for use stored in some string builder.

In this case developer will be responsible to have correct html but it's ok when major performance wins can be achieved.

Just give me way to tell component to skip html generating heavy task and I will provide it under my responsibility.

I know razor pages are default and promoted way to construct blazor components but if we can have also opportunity to get faster components using RenderTreeBuilder will be great.

I understand that I can't see big picture and there can be something making my request stupid, sorry if it's the case.

@SteveSandersonMS
@rynowak
@javiercn

@Postlagerkarte
Copy link

I don't know if this is related but a major showstopper for us adapting Blazor is the lack of a fast DataGrid component. We currently run AG Grid + Angular and it is blazing fast. Currently available commercial Blazor Grids are slow (with larger dataset) - it really hurts! Same issue is pointed out from others: #21514 (comment)

@javiercn javiercn added the area-blazor Includes: Blazor, Razor Components label Jun 1, 2020
@SteveSandersonMS
Copy link
Member

@Lupusa87 If you could provide a fairly minimal example of the kind of component structure you're trying to render where prerendering is slow, we could try to focus our investigations and optimization efforts around that kind of scenario.

It's possible also that something in your scenario is triggering unusually bad perf behavior and we might be able to help suggest an alternative.

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Jun 1, 2020
@Lupusa87
Copy link
Contributor Author

Lupusa87 commented Jun 2, 2020

@Postlagerkarte you can check my VirtualGrid comp used in virtual grid demo, live here.
This was POC having both rows and columns virtualization, I was actively working on it year ago, it is not ready for use comp but can help you to see how it can works.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Jun 2, 2020
@Lupusa87
Copy link
Contributor Author

Lupusa87 commented Jun 2, 2020

@SteveSandersonMS Thank you, I will prepare separate repo and link here very soon.

One thing to double check, is htmlrenderer used only for prerender or for regular blazor routine?

If only prerender than does not really makes sense to continue talking about htmlrenderer because I have not issues with prerender.

My problem is that blazor comp is working slow when it updates frequently.
e.g. scrolling in grid, there is displayed about 50 cells in virtual grid at the time which should get updated values but has delays, also showing gc activity in consol which means heavy usage of resources.

In my current case I have text where some letters are randomly converted to another alphabet based user slider input, it mens also frequent refresh of component which causes delays and gc activities.

@mkArtakMSFT
Copy link
Member

Thanks for contacting us. We're going to address the leftover work here as part of #22432

@ghost ghost locked as resolved and limited conversation to collaborators Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.
Projects
None yet
Development

No branches or pull requests

5 participants