| Author |
Message |
silviu
Joined: 01 Feb 2013 Posts: 2
|
Posted: Fri Feb 01, 2013 1:59 pm Post subject: Strange behavior when profiling methods that uses EF |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Mon Feb 04, 2013 12:07 pm Post subject: |
|
|
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). _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
silviu
Joined: 01 Feb 2013 Posts: 2
|
Posted: Mon Feb 04, 2013 2:41 pm Post subject: |
|
|
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 |
|
 |
|
|
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