ant-design-blazor / ant-design-blazor

🌈A set of enterprise-class UI components based on Ant Design and Blazor.

Home Page:https://antblazor.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extreme CPU usage by Ant-Blazor Select-Component

true-perfect-code opened this issue · comments

Dear Ant-Community

I have also reported this problem to CommunityToolkit, see: CommunityToolkit/Maui#1837

The problem only occurs with MAUI Blazor if you install the .NET MAUI Community Toolkit. It appears when the Ant-Select component hangs and this happens because the CPU usage becomes extreme.

I have canceled the execution a few times and have seen that the execution rotates at the focus event in the Select.cs of Ant.

Interestingly, this problem does not exist with HTML Select, which leads to the conclusion that it most likely has to do with fired events (in Ant).

If you try it with older Ant versions, for example 16, then the problem also exists there.

Here is github project to reproduce this problem: https://github.com/true-perfect-code/MauiAppAntToolKit

And here's what it looks like
image

Regards
pc

Hey @true-perfect-code , it works well on my machine.

Hi @ElderJames

I have looked at the GitHub repo on another compute and I can confirm the problem, but it is not extreme like on the actual PC. This is probably also because I ran repo on an Intel Core i3-8100. I don't notice any delay on this PC, but you can see in the task manager that the CPU utilization is very high for up to 10 seconds, which shouldn't be the case.

I know Ant doesn't need a new "bug", but maybe it wouldn't be a bad idea for the owner of the Select component to take a look at this problem and see where this extreme CPU utilization is coming from when using MAUI ToolKit Nuget?

Here is CPU usage on Intel Core i3-8100, Windows 11
image

Thank you
pc

It seems that the problem comes from the Ant component after all. Please check:

CommunityToolkit/Maui#1837 (comment)

Can the developer of the select-component have a look at this in debug mode, he will be able to find out very quickly where the problem is?

Thanks
pc

@true-perfect-code: After I removed the CommunityToolkit.Maui.Core package, it seems to be working well. Taking into account that this bug will require some time to fix, if this package is not essential, you can try removing it firstly.

@pankey888 : Unfortunately, CommunityToolkit cannot be removed because it is used in MAUI NET (e.g. loading a file from the drive).
Blazor + ANT is an excellent platform to write applications for the web, desktop and mobile with a common code base.

Workaround at the moment is a simple HTML list field instead of ANT List.

pc