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

Memoryleak / Incremental render updates in scheduler #1707

Open
HansenBerlin opened this issue Sep 23, 2024 · 2 comments
Open

Memoryleak / Incremental render updates in scheduler #1707

HansenBerlin opened this issue Sep 23, 2024 · 2 comments

Comments

@HansenBerlin
Copy link

Description

If an appointment item is dragged/moved in the scheduler (weekview) this triggers the slot changed event for every pixel(?) the item is being dragged. This causes a huge overhead, up to crashing the application if any conditional logic is happening within the event method (like changing styles etc.)

Reproduction:

  1. Go to https://blazor.radzen.com/scheduler?theme=material3
  2. in the first example add this line at the end of the OnSlotRender method: console.Log($"SlotRender: Start={args.Start} End={args.End}");
  3. Click on run
  4. Drag one of the appointments for a very short period. There is a slight delay but it works
  5. Drag one of the events around for one or two seconds. The console is filled with output and depending on the timespan the appointment was dragged the website completly freezes.

Expected behavior

Not crashing... :-) Either a way to throttle the update frequency or to not update at all. In my case I render the backgrounds of the slots only once based on some business logic (holidays etc.). The actual appointments can change but wouldnt cause the slots to change, so in that case some switch to disable rerendering the slots completly would be nice.
As a workaround I tried returning from the method without changing the style (after it was changed once already), but then the current style is wiped.

@akorchev
Copy link
Collaborator

Not sure if we can address that. Blazor does the event handling and UI updates.

@illiniguy
Copy link

illiniguy commented Sep 26, 2024

FWIW I personally don't see that issue if I use the demo as-is. That added line of code and the overhead of printing to that console I think is what causes it to go haywire. If I follow the added step I saw the same freezing, etc. But if I use the demo as-is I only saw CPU go up in the tab but memory, responsiveness, etc. seemed fine. I assume if you had a needed side effect you could debounce it yourself to only write to console for instance after a certain time passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants