I have a website (json-everything.net) that is suffering from some performance issues that are most noticeable when attempting to type in the code editors on the page.
I had originally thought it was an issue with the code editor and having multiple editors on the page at once, but in my report to them, they pointed out that it was a key-up event being handled by the many RadzenPanelMenuItem
s. To confirm this, I ran it locally, commenting out the menu item generation, and the performance issue was gone.
I don't know if it's the menu item itself handling the event or if it's something in my code, but this slowness is horrible. I've dug through the menu item component code, and I don't see anything that would be causing these issues. This is just the next thing to look at.
The code where this is used can be found here:
(I'm only allowed two links per post for some reason)
The razor page contains a single ApiIndex
component, which is composed of multiple recursive ApiNamespace
components. This is generated using reflection on page initialization.
Please forgive any bad code/architecture. I'm generally a back-end/library dev in general (not familiar with front-end things), and I'm new to Blazor.
Hi @gregsdennis,
Neither RadzenPanelMenu nor RadzenPanelMenuItem handle any key related events. You can check their source code in our github repository.
You can try two things to find what the culprit is:
- Replace the code editor with a regular
<textarea>
and see if things improve. If they do - the culprit is the code editor component that you use.
- Replace RadzenPanelMenuItem with the builtin NavLink component. If performance improves then the culprit is RadzenPanelMenuItem.
Unfortunately we can't run or troubleshoot your application due to higher priority tasks.
Thanks for the troubleshooting suggestions.
Switching to NavLink
removes the performance issue, so the problem is definitely in the RadzenPanelMenuItem
somewhere.
I'll file an issue in the repo.
Turns out it's not either component. It's my handling of KeyUp
in the editor. I need to do that differently.