-
Notifications
You must be signed in to change notification settings - Fork 377
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
fix: Page with FluentButtons becomes slower and slower #871
Comments
Hi, I ran your test code locally in 2 runs and got the following results: 2nd run: With the first run, I made a change in the code to not call the With the 2nd run, I did indeed see the times go up, but I was refreshing the page quite quickly. When I waited a bit after the longest rendering, the next runs were fast again. It seem like the .NET Garbage Collector just needs time to catch up (which is not surprising as we are creating 2500 components each run). |
Hi,
still the same result: When using FluentBadge instead of FluentButton the rendering time is stable. |
Are you testing it with a Server or a WebAssembly project? |
I'm testing it with a Server project. Changed the code to this:
When just hitting refresh in the browser, I see the render time being stable. Also, the |
I was creating the project with |
Looks like a memory leak in FAST lib - Detached Elements in dev tools shows that 2500 buttons become detached after each navigation from Buttons page. This happens because of:
|
Great find @andreisaperski! I'll make the FAST team aware. |
@andreisaperski Do you perhaps have a minimal repo where the FAST team can look at to see the MatchMediaStyleSheetBehavior issue? Please see the linked issue in the fluentui repo above . Thanks. |
@vnbaaij added a link to the repo and a bit more details there. the current FormAssociated fix is only a half of the memory leak fix. |
Closing this as the issue has been fixed on the FAST / Fluent UI side. New script version will be in next release (v4.5) |
@vnbaaij looks like it has been partially fixed and the memory leak is still there. MatchMediaStyleSheetBehavior is not unbined - after several nagivations to Button page (and back to Couter page) from the example and GC, there're 17.5k detached buttons: Media query linsters ('forced-colors') are roots that prevent GC of buttons: These listeners are created by MatchMediaStyleSheetBehavior: |
Yes, it is indeed only partially fixed...reopening it |
Closing this as it will most probably not be fixed on the current FAST version anymore (with FAST element being archived) |
🐛 Bug Report
Page with a lot of buttons becomes slower and slower
💻 Repro or Code Sample
dotnet new fluentuiblazorserver -n ButtonTest
Update NuGet to 3.2.0
Add ButtonPage:
Rendering took 384 ms
Rendering took 434 ms
Rendering took 627 ms
Rendering took 662 ms
Rendering took 831 ms
Rendering took 942 ms
Rendering took 1124 ms
Rendering took 1296 ms
Rendering took 1439 ms
Rendering took 1582 ms
🤔 Expected Behavior
Rendering time should stay the same.
😯 Current Behavior
Rendering time increases every time page is shown.
💁 Possible Solution
🔦 Context
Measuring performance
🌍 Your Environment
Windows 10 Enterprise
Visual Studio 17.7.4
Chrome 117
.NET SDK 7.0.401
The text was updated successfully, but these errors were encountered: