MiniProfiler Showing Asp.Net Mvc Slow Call Actions Occasionally
Asked Answered
M

1

12

We have started using MiniProfiler and it is showing that sometimes, particularly when we hit F5 when running in Visual Studio that the first 3 - 5 calls to an action are very slow before any of our code executes as the picture below shows, it always seems to be approximately 5, these are actions which return an image but as MiniProfiler is showing all the time is occurring before any of our code even executes, if I comment out the image that is taking 2050ms then another that is taking 0.5ms simply takes this long. We have set debug=false in web.config which has made no difference.

We are using both the ProfilingActionFilter and ProfilingViewEngine but is there another way to profile what is happening here and trying to work out?

EDIT: We are also using AutoFac, is it possible this is the cause, I'm trying to find a way of profiling everything so I can see exactly where this is happening.

EDIT: OK So I added my own ControllerFactory which profiles and a route constraint, as the new image below shows all the time is happening before the route constraint or controller is even created, before the Application_BeginRequest. I'm at a complete loss as to what is taking so much time. Looking at this link of the MVC pipeline what can be left?

http://blog.stevensanderson.com/blogfiles/2007/ASPNET-MVC-Pipeline/ASP.NET%20MVC%20Pipeline.pdf

enter image description here

enter image description here

Minnich answered 30/5, 2013 at 7:13 Comment(1)
Have you tried running this application without Visual Studio? Have you tried profiling it then?Calendar
C
-2

I had similar issues recently with miniprofiler where i saw this big number at the beginning of the trace like yours and had no idea what was going on. recently tried http://prefix.io which gave much deeper profiling on what was actually causing that large number - in our case it was excessively hitting the cache to retrieve the same object multiple times.

Knowing that we were able to reduce the page load time by a lot. Your case may be different or similar only a deeper profiling will tell you. It also shows you time spend in different HttpModules and Handlers.

Coleville answered 2/6, 2016 at 5:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.