| Author |
Message |
GSchroder
Joined: 30 Jan 2013 Posts: 3
|
Posted: Wed Jan 30, 2013 10:45 am Post subject: Profiling Parallel.ForEach |
|
|
I have noticed when profiling my app all my systems cores are not utilized when using a Parallel.ForEach. When I run the app from VS 2012 they do as expected, but not when profiling?
I am profiling it using the ASP.NET web application (web development server) option (.NET 4). Only thing that's different is the profiler seems to use VS 2010 web dev server, whereas I'm using VS 2012. This shouldn't make a difference though |
|
| Back to top |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 442
|
Posted: Thu Jan 31, 2013 2:37 pm Post subject: |
|
|
ANTS uses ThreadAffinity which helps it co-ordinate clock ticks for all threads.
If you want to utilise more cores (and will accept a certain amount of uncertainty on the results), locate your settings file :
%USERPROFILE%\AppData\Local\Red GateANTS Performance Profiler 7\PerformanceProfilerSettings.xml
and set ThreadAffinity to false.
<property name="UseThreadAffinity"> <object type="System.Boolean">False</object> </property>
and retry
Please let me know if that helps! |
|
| Back to top |
|
 |
GSchroder
Joined: 30 Jan 2013 Posts: 3
|
Posted: Thu Jan 31, 2013 3:18 pm Post subject: Re: |
|
|
| Chris.Allen wrote: |
| If you want to utilise more cores (and will accept a certain amount of uncertainty on the results) |
Thanks for the reply. What exactly do you mean by a certain amount of uncertainty? The timing could be off between cores leading to some execution times possibly being inaccurate? And ballpark what sort of amount are we talking here? |
|
| Back to top |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 442
|
Posted: Thu Feb 07, 2013 3:11 pm Post subject: |
|
|
>> The timing could be off between cores leading to some execution times possibly being inaccurate?
Precisely. Apparently, clocks aren't synched between cores and no correction is made for this.
>>And ballpark what sort of amount are we talking here?
I'd say between 5 and 10% but there's bound to be pathological cases.
I'd run both sessions (with and without affinity). Trust *percentage* values for ThreadAffinity = true; trust absolute and real-world performance values for ThreadAffinity = false.
And if there's major discrepancies between the two, be sceptical about specific ThreadAffinity = false values.
Profiling is more of an art than a science. |
|
| Back to top |
|
 |
GSchroder
Joined: 30 Jan 2013 Posts: 3
|
Posted: Fri Feb 08, 2013 8:37 am Post subject: |
|
|
| All makes sense, thanks for the response Chris |
|
| 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