views:

53

answers:

1

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?

+2  A: 

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.

Justin Niessner
I'll give those a look. The optimizations are fairly basic/solid stuff though - not using an Int32 when a Byte will do, etc. No fancy tricks.
Ducain
@Ducain: If what Justin is suggesting is true, you can also try to target .NET 2.0 in VS 2010 and see if you can get the performance back to where it was.
adrift
@Adrift - unfortunately I can't. A project referenced by this app now targets 4 (out of necessity). The project is a data access layer and so doesn't affect the area of code I'm dealing with here, but in order to compile the solution, I have to target .NET 4 now.
Ducain
Marking this as the answer. It's definitely the framework. As to the specific framework changes that CAUSED this trouble - who knows. However, I took Justin's suggestion and I'm using Red Gate's ANTS trial version and I'm loving it. Already knocked significant time off thanks to this tool.
Ducain