Comments
8 comments
-
Perhaps if you try using 'All .NET methods' when you choose which code to profile will help. It may well be that .NET is doing a lot under the covers which you have no control over.
If it needs to compile your ASP.NET application that will slow it down considerably for example. -
I did try that but it doesn't really make any difference. I have four methods between .1 and .4 seconds. That still doesn't tell me why certain parts of the app are taking seconds to run. I did click on the slower parts of the app hoping to profile them.
-
Hi Brett,
Are you looking at the "time" or "time with children" values? (Or, on the summary page, the "Slowest methods with children" section)
The latter will include any calls to other methods, and will probably give you more useful information - that's effectively the time taken between that method entering and it returning.
Hope that helps,
Robert -
Ah! After I click the "All methods" tab and sort on Time with childrent, I see where all of the time is. I suppose the profile all .NET methods helped here as well. It doesn't actually appear to be my code but the .NET framework that is taking so long. Must of the 9+ second time is in:
System.Web.UI
and
System.Web.Util
My code is mostly in the below .01 time range. What do you recommend for people in these scenarios? Is there a way to tweak an app with code you have no control over? Maybe I'm still not understanding the results.
This code (.NET namespaces) is very intertwined with my own code. If Ants could point out where I reference certain things, maybe I could restructure those parts or get a better understanding of why it is so slow. However, if I click a line from the top pane, it doesn't show any source code or where I reference it.
Thanks,
Brett -
Hi,
That sounds more promising at least :-).
If you look in the hierarchy panel (you may need to make this visible from the View menu first, if it isn't already), you should be able to see all the methods that called the current method. You can then use this to navigate upwards until you get into your own code, at which point the source should be available, and the context should be more meaningful.
As a separate note, if you haven't already, you might want to check that your web.config specifies "debug=true", or you won't see the source code for your pages, nor will you get line level timings in detailed mode.
As for why the Web.UI annd Web.Util namespaces are so slow, I'm afraid you've gone beyond my knowledge there - I'm not an ASP.NET developer personally!
Regards,
Robert -
Thanks. I see in the hierarchy some of these system methods are called 644,000 + times just in a few page clicks. I don't know if that is normal. But the total time listed is only .0514. Does that sound correct? If it is, I get that number of calls is fine.
I suppose now it's more to do with finding out what exactly these system methods mean. For example, there is a method named PipelineRuntime.GetRoleDelegate() that takes 63.1684 seconds. There isn't any further drill down for it. I'm not sure what it does or if there is a way to directly tweak it or work with it in my code. These are the issues I seem to face now. Do you have any suggestions for this? Or how are others using Ants correcting it?
If all of my problems are in system methods, how can Ants help me?
Thanks,
Brett -
Hi,
The answer to that of course depends on how much work the method does. I think the numbers you're getting sound believable - so to that degree, I wouldn't worry about that if they're deep down in the bowels of ASP.NET.
As for what the particular method you mention does, searching the web for it turned up absolutely no hits at all, and even just "GetRoleDelegate" only came up with a couple relating to Java!
I think you'd most usefully look only at your own code, and maybe one level deep into the system methods. As you say, you have no control over them beyond that, so there's little value in going down all the way. The "time with children" field is the key here.
That said, whilst you can't help how long system methods take, you might be able to reduce the number of them that you cause to be called - and that's really where the performance increase can come from.
For example, if you're performing a load of method calls to repeatedly get the same information in a loop, changing your code to only retrieve it once might really help.
Thanks,
Rob -
Thanks. I'll see which methods I can work with and try to figure out if there are ways to avoid over using them.
As for the GetRoleDelegate() method, the drill down doesn't go any where. I'm assuming that means I'm stuck with it. I am using the asp.net membership/roles framework. Probably the only way to test this is to make a copy of the site that doesn't use that framework. If there is a difference in the site not using the membership/roles framework, I'm really getting somewhere by saving over a minute since I don't much utilize that framework anyway. I'm sure I'll find other related bottlenecks as I explore more.
Thanks again.
Add comment
Please sign in to leave a comment.
Thanks.