title: Performance differences between P/Invoke and C++ Wrappers
body: <p>In the process of learning P/Invoke, I asked this previous question:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/1422701/how-to-p-invoke-when-pointers-are-involved">How to P/Invoke when pointers are involved</a></p>
  </blockquote>
  
  <p>However, I don't quite understand the implications of using P/Invoke in C# over creating a wrapper in Managed C++. Creating the same DLL using P/Invoke in C# definately resulted in a cleaner interface since I could use DLLImport on an embedded resource, but would a Managed C++ wrapper for a native DLL, where I do the marshaling myself, have better performance?</p>