Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiled program runs MUCH slower after I switched to VS 2010

One of our critical company apps (C#) crunches hi-rez images, and we've made great efforts to optimize it. It performes over 2.5 million operations in ~ 2.5 seconds.

We've used VS 2005 for years, and last week, moved everything over to VS 2010.

Same exact project code.

Now, when I build the app and run it (outside the VS 2010 IDE), the very same operation takes 5 + seconds every time.

This is a big issue, and absolutely hurts my brain. I currently have it set to Release mode (same as I had it in VS 2005).

Any idea what could be causing a doubling of the execution time when the code is precisely the same?

like image 344
Ducain Avatar asked Sep 21 '10 17:09

Ducain


1 Answers

You are probably seeing the change because you switched from targeting the .NET 2.0 runtime to the .NET 4.0 runtime.

You mention you highly optimized the code for performance. My guess is that some of the optimizations are actually hurting your performance rather than helping it now (since internal implementation details of the Framework that you relied on for optimization have changed).

My suggestion would be to run your code through a Profiler (like Redgate's ANTS Performance Profiler or JetBrain's DotTrace) and see where the new bottlenecks are. You can move forward from there.

like image 173
Justin Niessner Avatar answered Nov 15 '22 06:11

Justin Niessner