Red Gate forums :: View topic - Strange behavior when profiling methods that uses EF
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 7
ANTS Performance Profiler 7 forum

Strange behavior when profiling methods that uses EF

Search in ANTS Performance Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
silviu



Joined: 01 Feb 2013
Posts: 2

PostPosted: Fri Feb 01, 2013 1:59 pm    Post subject: Strange behavior when profiling methods that uses EF Reply with quote

Hi,

I have the following EF query:

DbContext.Priorities.OrderBy(x => x.Value).ToList()

Where Priorities maps over a table with only 4 records.

When I profile with ANTS Performance Profiler 7.4 says that it takes about 3 seconds, most of the time is spent in 46013 hidden methods without source. The corresponding SQL query takes just a few ms.
I'm profiling an ASP.NET web application (IIS) using Line-level and method-level timings method.

The same method but without the profiler started takes less than 200 ms.


Do you have any clue why the profiler is slowing that particular EF call?

Regards
Silviu
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6674

PostPosted: Mon Feb 04, 2013 12:07 pm    Post subject: Reply with quote

Hello,

If the methods involved are really small, you may want to try disabling overhead correction in ANTS Performance Profiler settings. Unfortunately, with tight code loops, overhead correction can sometimes distort the times, and this is especially true for recursive code loops.

I'm also not certain if the comparison is valid because I don't know what you used to come up with the 200ms figure - if you are using a different profiler, you'll want to use like-for-like settings (CPU time, source code/no source code, etc).
Back to top
View user's profile Send private message
silviu



Joined: 01 Feb 2013
Posts: 2

PostPosted: Mon Feb 04, 2013 2:41 pm    Post subject: Reply with quote

I disabled overhead correction but that didn't help.

The 200 ms I measured using DateTime.Now before and after that method call.

I send an email to Red Gate Support <internalsupport@red-gate.com>, subject "RE: Your Red Gate Forum Topic: F0069192", with a screen-shot in ANTS Performance Profiler showing the problem I'm facing.

GetPriorityList() method call takes 2,636 ms (Wall-clock time with Children), inside that node we have JIT overhead with 2,339 ms, inside which we have other JIT overhead with 0,001 ms and Profiler overhead with 0,001 ms.

It seems that it's from JIT overhead, but when I'm running without ANTS profiler started there is no overhead.[/img]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group