I am trying to make my application faster. Besides optimizing the algorithms, introducing caches etc. I'd like to better scale with hardware, i.e. make use of multiple CPUs/cores or hyperthreading.

So I find myself converting simple loops into parallel loops (Parallel.For() / Parallel.ForEach()) and I wonder whether there's a Visual Studio plugin that would automate this task.

The plugin

  • should be gratis
  • must work with for and foreach loops
  • must work in Visual Studio 2015 (Visual Studio 2013 would be nice as well)
  • needn't find out by itself whether the loop body causes threading issues. That's something I'll do myself.
  • may depend on JetBrains ReSharper (8.2 or higher)
  • must not use external libraries for parallelism (like GPU libraries or Intel Parallel library)
  • 3
    I'm not sure you should do this as a blanket change. A loop being "parallizable" depends on a lot of things and just blindly changing them can cause potentially large bugs. I'd also say that in some cases, using a parallel loop can actually make things slower, not faster. That being said, you could write a Fody plugin that does this, but I don't think there is anything out there that does it since it really isn't as easy as "change every loop". – Ron Beyer Dec 21 '15 at 15:58
  • 1
    Sure. I'am using a profiler before and I'm checking the loops manually for threading issues. – Thomas Weller Dec 22 '15 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.