-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Using bind causes massive traffic in server side blazor #10558
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
Comments
FYI what is changing on every mouse move is the event handlers. You’re disposing 1000 handlers and assigning 1000 new ones on each mouse move. This is because the framework can’t detect that the new handlers are functionally equivalent to the old ones. |
To add to what @SteveSandersonMS has mentioned here, we're going to introduce a mechanism for reducing the impact of these type of aggressive events on the server as part of #10522 |
@SteveSandersonMS is there anything else we plan to do here? |
I'm not the author of original question, but after reading the answer from @SteveSandersonMS I have to say that I don't know which event handlers are disposed and assigned again. Please note that according to the author second example with @mkArtakMSFT I agree that we need event throttling but the problem described above is different. |
/ping @SteveSandersonMS |
Not certain what I'm being pinged for. This is scheduled to be investigated for 3.1, right? |
We've moved this issue to the Backlog milestone. This means that it is not going to happen for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources. |
@jsandv Are you still seeing this behavior with latest bits? |
@ChristianWeyer yes im seeing this in latest bits. Current steps to reproduce is having either section 1 or section 2 commented in. `
` |
I have the same issue with a diagram component i'm working on. The structure of my page is similar to the sample above,
And multiple child rectangles where i'm capturing the selection events:
So my question is, does it make more sense to move all child event bindings |
Closing as dup of #10522. |
Im working on a small simple drawing tool in server side blazor using the latest template in VS2019 .net core 3-preview. When I was stress testing my app, adding 500 elements it became extremely unresponsive.
When inspecting the websocket connection i saw lots of packages over 35kb while moving the mouse. This does not make sense to me, because im not changing anything.
Anyways after some experiments I have located something suspecious causing this.
Using bind on an element like this:
1)
<input type ="text" bind="@Text"/>
is completely diffrent then this:
2)
<input type ="text" value="@Text" onchange="@(e=>e.Value)"/>
The first one is resending entire page over websocket each mouse move (which seems to be at least 10 times per second)
The second one is resending entire page over websocket only when I change the text.
1)This one using bind sends 35kb packages
This one works as expected with regards to data sent over websocket
The text was updated successfully, but these errors were encountered: