Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net MVC: why is AreaRegistration.RegisterAllAreas() so slow?

I have a small ASP.net MVC application with approximately 10 Views and 2 Controllers, which takes forever (not forever but between 30-50 seconds) to load a site.

I did some profiling and found out that over 50% of the time was spend on the following line in my Global.asax.cs file:

AreaRegistration.RegisterAllAreas();

What could be the reason and how can I improve the performance?

like image 576
Preli Avatar asked Jan 05 '12 12:01

Preli


1 Answers

Are you using MVC Areas? If not, simply remove or comment that line out. I've noticed this before but have no real explanation for it.

like image 152
Anthony Shaw Avatar answered Sep 19 '22 23:09

Anthony Shaw