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 WASM] Massive UI lag when typing in an input of a complex component #29425

Closed
Flaflo opened this issue Jan 19, 2021 · 10 comments
Closed
Assignees
Labels
affected-medium This issue impacts approximately half of our customers area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-component-model Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc) feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-rendering Features dealing with how blazor renders components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue severity-blocking This label is used by an internal tool Status: Resolved
Milestone

Comments

@Flaflo
Copy link

Flaflo commented Jan 19, 2021

Describe the bug

This bug is known since 2019 but nothing was done against it. It was reported here #17951 and added into the .NET 5 sprints but was closed and locked without actually fixing the bug or providing an acceptable workaround. To be honest, this makes me a little bit upset because clearly this is a critical performance issue.

To Reproduce

This should not be that hard, but I think the best way to reproduce is to use some component library such as https://mudblazor.com/ and create a dialog with many input fields inside.
Any other information can be taken out of the closed issue all of it is already there.

Further technical details

  • ASP.NET Core 5.0.2
  • Blazor WASM
  • Basically everything on 5.0.2

Please fix this and dont ignore this issue. I am not the only one having problems with this. It is mandatory for Blazor to be used in bigger business applications. The current performance in complex environments is not acceptable.

@Flaflo Flaflo changed the title [BLAZOR WASM] Massive UI lag when typing in an Input of a complex Component [BLAZOR WASM] Massive UI lag when typing in an input of a complex component Jan 19, 2021
@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Jan 19, 2021
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jan 19, 2021
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Jan 19, 2021
@ghost
Copy link

ghost commented Jan 19, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@Flaflo
Copy link
Author

Flaflo commented Jan 21, 2021

The discussion in #18919 is about the same topic and also worth reading.

@SteveSandersonMS SteveSandersonMS added affected-medium This issue impacts approximately half of our customers severity-blocking This label is used by an internal tool labels Jan 26, 2021 — with ASP.NET Core Issue Ranking
@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, 6.0-preview4 Mar 19, 2021
@TanayParikh TanayParikh self-assigned this Mar 22, 2021
@javiercn javiercn added feature-rendering Features dealing with how blazor renders components feature-blazor-component-model Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc) labels Apr 20, 2021
@TanayParikh TanayParikh added the blocked The work on this issue is blocked due to some dependency label May 7, 2021
@danroth27
Copy link
Member

@TanayParikh What is this issue blocked on?

@TanayParikh
Copy link
Contributor

We have a few parallel efforts (#30289, #21877, #27885) we're currently tackling which should give us the tools necessary to make this process more efficient & performant.

@TanayParikh TanayParikh modified the milestones: 6.0-preview7, 6.0-rc1 Jul 13, 2021
@ghost ghost added the Working label Jul 27, 2021
@TanayParikh TanayParikh added Working ✔️ Resolution: Duplicate Resolved as a duplicate of another issue and removed Working blocked The work on this issue is blocked due to some dependency labels Jul 27, 2021
@ghost ghost added the Status: Resolved label Jul 29, 2021
@TanayParikh
Copy link
Contributor

TanayParikh commented Jul 29, 2021

Tracking the fix for this issue in #30291. We'll be implementing a new component LargeInputTextArea which allows for async retrieval of the text area content without support for validations/binding (as those would require sending the entire textarea's content to the server everytime).

@ChristianWeyer
Copy link

Are you really addressing the original poster's issue? @TanayParikh
He was not talking about Blazor Server, AFAIK.

@TanayParikh
Copy link
Contributor

TanayParikh commented Jul 29, 2021

Are you really addressing the original poster's issue? @TanayParikh
He was not talking about Blazor Server, AFAIK.

I wasn't able to repro the UI lag for Blazor WebAssembly, I only encountered it on Blazor server using a text area with 20k+ chars. This was due to the added overhead of JS->.NET interop on 20k+ chars on each key press, alongside the network overhead. Reducing the JS->.NET interop overhead will have performance benefits for Blazor WebAssembly as well.

If you're encountering this issue specifically in complex components, I'd encourage you to review the Blazor WebAssembly Performance Best Practices which details rendering optimizations to resolve the issue. In that case, I'd say this issue is a duplicate of/resolved via #18919.

@ChristianWeyer
Copy link

FYI @Flaflo

@Flaflo
Copy link
Author

Flaflo commented Jul 30, 2021

Are you really addressing the original poster's issue? @TanayParikh
He was not talking about Blazor Server, AFAIK.

I wasn't able to repro the UI lag for Blazor WebAssembly, I only encountered it on Blazor server using a text area with 20k+ chars. This was due to the added overhead of JS->.NET interop on 20k+ chars on each key press, alongside the network overhead. Reducing the JS->.NET interop overhead will have performance benefits for Blazor WebAssembly as well.

If you're encountering this issue specifically in complex components, I'd encourage you to review the Blazor WebAssembly Performance Best Practices which details rendering optimizations to resolve the issue. In that case, I'd say this issue is a duplicate of/resolved via #18919.

Yes, its related to #18919 but my problem here is specifically that a re-render is triggered if a text input event is happening. This makes no sense.
We temporarily fixed this by a shouldRender bool as described in the related issue.

@TanayParikh
Copy link
Contributor

Yes, its related to #18919 but my problem here is specifically that a re-render is triggered if a text input event is happening. This makes no sense.
We temporarily fixed this by a shouldRender bool as described in the related issue.

I believe https://docs.microsoft.com/en-us/aspnet/core/blazor/webassembly-performance-best-practices?view=aspnetcore-6.0#avoid-rerendering-after-handling-events-without-state-changes may be what you're looking for in that case.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-medium This issue impacts approximately half of our customers area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-component-model Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc) feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-rendering Features dealing with how blazor renders components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue severity-blocking This label is used by an internal tool Status: Resolved
Projects
None yet
Development

No branches or pull requests

7 participants