Managed to Unmanaged C++ Performance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am exposing a legacy unmanaged C++ class library and deciding whether to
use COM or .NET approach. I have a COM DLL containing the legacy (unmanaged)
code, and a .NET class library containing the legacy code. My initial
performance testing showed .NET much slower than COM when executing the same
unmanaged code. After some investigation I see that I seem to be spending
significant time doing CArray::SetData() calls in the unmanaged code within
the .NET class library. If I break out the legacy code into a separate
unmanaged DLL, and simply access it from the .NET class library, the same
CArray::SetData() calls are orders of magnitude faster, and the .NET approach
now challenges the COM approach performance. Can anyone explain this
behavior?
 
MC

There will always be parts that can be done by one runtime quicker than
another runtime or native code.

However did you try this in a real hug application.
A simple native program will certainly win from managed code however as soon
as it grows, that will go in an opposite direction, because nobody can code
efficient with only native code.

Just my idea,

Cor
 
Back
Top