Red Gate forums :: View topic - Profiling Parallel.ForEach
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

Profiling Parallel.ForEach

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



Joined: 30 Jan 2013
Posts: 3

PostPosted: Wed Jan 30, 2013 10:45 am    Post subject: Profiling Parallel.ForEach Reply with quote

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
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 594

PostPosted: Thu Jan 31, 2013 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
GSchroder



Joined: 30 Jan 2013
Posts: 3

PostPosted: Thu Jan 31, 2013 3:18 pm    Post subject: Re: Reply with quote

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
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 594

PostPosted: Thu Feb 07, 2013 3:11 pm    Post subject: Reply with quote

>> 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
View user's profile Send private message
GSchroder



Joined: 30 Jan 2013
Posts: 3

PostPosted: Fri Feb 08, 2013 8:37 am    Post subject: Reply with quote

All makes sense, thanks for the response Chris
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