This is a migrated thread and some comments may be shown as answers.

PanelBar and Menu Extremely Slow to Render

4 Answers 494 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Veteran
Iron
Eric asked on 27 Jul 2020, 03:11 PM

I have a Kendo PanelBar and Menu declared in my MVC Layout and they slow down my page render by about 10 seconds each.  These used to be Telerik controls for MVC 3, and I made minimal code changes to convert them to the Kendo controls for MVC 5.  The old Telerik version does not experience these slow load times.  I know that my PopulateSiteMapAttribute is not the issue, as that code takes 0 seconds to run.  Can you give me any clues as to what might be causing this slowness?

 

If I remove this block from my MVC Layout, the page renders 20 seconds faster:

@{ Html.Kendo().Menu()
         .Name("TopNavigation")
         .HtmlAttributes(new { @class = "topNavigation" })
         .BindTo("PA.web.mvc.sitemap", (item, node) =>
         {
             if (!string.IsNullOrEmpty(node.ControllerName) && !string.IsNullOrEmpty(node.ActionName))
             {
                 item.ControllerName = node.ControllerName.ToLower();
                 item.ActionName = node.ActionName.ToLower();
                 item.Text = node.Title.Substring(0, node.Title.IndexOf("|"));
 
                 item.HtmlAttributes.Add("class", node.Title.Substring(node.Title.IndexOf("|") + 1));
 
             }
         })
         .Render();
}

4 Answers, 1 is accepted

Sort by
0
Eric
Top achievements
Rank 1
Veteran
Iron
answered on 27 Jul 2020, 07:17 PM

I just found an article that talks about the SecurityTrimming option.  When I set it to false, everything speeds up to a reasonable rate.  Is this the recommended way of dealing with this?  I don't want to be setting SecurityTrimming to false for fear that I might accidentally publish that setting to production, and I don't really want to disable the debug mode, since I am often debugging in development.  What can I do to keep my application from slowing to a crawl and still be secure?

https://docs.telerik.com/aspnet-mvc/troubleshoot/troubleshooting

0
Neli
Telerik team
answered on 29 Jul 2020, 10:01 AM

Hello Eric,

I tried to replicate the issue in a sample project locally. However, the Menu loads for less than two seconds on my end.  In the test project, I used sitemap binding and about 10 Menu items with 5 subItems each. Could you please let me know if the Menu in your application is loading large data set of Menu items? Could you please give us more details on the PanelBar configuration and the data it is loading?

I will appreciate it if you could isolate the issue in a sample project and send it back to us so we could inspect and be more helpful with a possible solution.

As described in the article regarding the Menu performance issue - SecurityTriming is an option that could be disabled while in debug mode. When the application is deployed the authorization context objects are cached.

Looking forward to your reply.

Regards,
Neli
Progress Telerik

0
Eric
Top achievements
Rank 1
Veteran
Iron
answered on 29 Jul 2020, 12:55 PM

I have permanently disabled the SecurityTrimming option, since we manually remove any menu items that the user is not authorized to access.  This has allowed our pages to render in 1 second, where they were taking 30 seconds with SecurityTrimming set to true. 

We only had 3 items in the Menu and another 3 in the PanelBar.  I would not say that is a lot of records, so I do not understand why it takes so long for SecurityTrimming to happen.

0
Neli
Telerik team
answered on 31 Jul 2020, 08:09 AM

Hello Eric,

It seems you have found a solution in your specific scenario. I am glad to hear that. 

However, there should be no performance issues with 3 items in Menu and PanelBar. As I mentioned in my previous reply it took less than 2 seconds on my side with a lot more items. The Security Trimming was not disabled. 

In case the issue continues to persist and you need further assistance on it I would like to ask you to isolated in a sample project and send it to us. Thus, we could troubleshoot locally and advise you further.

Regards,
Neli
Progress Telerik

Tags
Menu
Asked by
Eric
Top achievements
Rank 1
Veteran
Iron
Answers by
Eric
Top achievements
Rank 1
Veteran
Iron
Neli
Telerik team
Share this question
or