Take the 2-minute tour ×  I was tasked to find out what's making
part of an application I was assigned to so slow. I decided to
give the trial of Redgate's Ants Profiler a go. When running it,
the majority of hot spots were contained with loops that the
original developer wrote as Parallel.For() loops.  Just to see
what effect it would have, I replaced them with standard for-
loops, and the profiler sped up by several seconds. However,
testing without a profiler, using a simple DateTime.Now
difference between the start and end of one such loop, shows
that the Parallel.For() loop is more than twice as fast.  Is it
possible that running the code through the profiler creates an
artificial bottleneck when trying to use the Parallel class?
share|improve this question The main purpose of a profiler is to
find slowness bugs, not to be fast. –  Mike Dunlavey Jul 20 '12
at 13:45 @MikeDunlavey I realize this. The problem is that the
program runs faster one with with the profiler, and slower
without, creating a discrepa