BCS Wrote: > IIRC managed<->un-managed calls are insanely expensive. If you do > this,profile > the Snot out of it to be sure you actually get a gain out of it.
I can confirm that. The thunk layer is pretty heavy weight and tends to allocate memory to boot. Additionally, I've tried using "unsafe" C# and the code gen doesn't seem to deal with that very efficiently. And lastly, it does really poorly optimizing value type structs so the builtin features that could theoretically get you closer to the metal don't in reality.
