Slow performance with mixed assembly
-
Hi, I wrote a program in Visual Studio 2005b2 (Winforms), but include many of my image processing algoritms written in unmanaged c++. These functions use SSE2, and array manipulations. However, compiling my new program (.Net) resulted in very poor performance, where the execution is so slow, compared to the same code when compiled in MFC. Why is that? I'm aware that .Net compiler generates MSIL, and it is compiled to native code on the fly during execution. Most articles online says that .Net code is slightly slower than pure code, but eventually the performance difference is too small to be noticed. In my case, the performance difference is big, and the program executes horribly! Am i doing something wrong? I thought my unmanaged code will be compiled as native code, while the others will be compiled as MSIL resulting in a mixed assembly, thereby maintaining my performance, but this is not the case. Any ideas? Also, i used #pragma unmanaged. Thanks,
-
Hi, I wrote a program in Visual Studio 2005b2 (Winforms), but include many of my image processing algoritms written in unmanaged c++. These functions use SSE2, and array manipulations. However, compiling my new program (.Net) resulted in very poor performance, where the execution is so slow, compared to the same code when compiled in MFC. Why is that? I'm aware that .Net compiler generates MSIL, and it is compiled to native code on the fly during execution. Most articles online says that .Net code is slightly slower than pure code, but eventually the performance difference is too small to be noticed. In my case, the performance difference is big, and the program executes horribly! Am i doing something wrong? I thought my unmanaged code will be compiled as native code, while the others will be compiled as MSIL resulting in a mixed assembly, thereby maintaining my performance, but this is not the case. Any ideas? Also, i used #pragma unmanaged. Thanks,
uus99 wrote:
Most articles online says that .Net code is slightly slower than pure code, but eventually the performance difference is too small to be noticed.
I am afraid you are just another victim of the propaganda, my friend. .NET is slow - period.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.