It can be down to managed / unmanaged transitions, depend on what's going on
inside the function, and lots of other factors. If you could post the
function along with its calling context, someone will be able to give you a
definitive explanation. We didn't actually find a significant performance
hit when we eradicated all the "#pragma unmanaged" directives from our maths
code, and we found that performance could be greatly affected by unnecessary
managed/unmanaged transitions. Unless you've got a really good reason to use
#pragma unmanaged, and unless that chunk of code is fairly large and doesn't
call back into managed code, you might be better leaving it all as managed
code.
Steve
"Z-Mechanic" <Z-********@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
Hello everybody!
I have a question. Anybody knows why managed function calls faster in MC++
rather than unmanaged function (defined with #pragma umanaged)? The
differences is about 4 times slower.
Thanks for your answers!
Z-Mechanic.