I rewrote a number-crunching two pages of code from C# to unmanaged C++ in my project, which with full optimizations gave a 3x speedup. I want to keep optimizing that code, but now my profiler of choice, dotTrace, can't do it, because it only looks at managed code.
How do I profile the P/Invoked C++ module when it's running in the C# app?
And a tangential question:
Calling the following function via P/Invoke doesn't produce any unneeded overhead (such as copying the arrays), right? Just making sure. (Note that Foo both reads from bar
and writes to it)
// From the C# side:
[DllImport("foo.dll")]
static extern void Foo(float[,] bar);
// From the C++ side:
extern "C" __declspec(dllexport)
void Foo(float* bar);
compiler: msvc on Vista