Coffeehouse Post

Single Post Permalink

View Thread: C# biggest awesome
  • User profile image

    Nobody mentioned P/Invoke vs JNI yet? I recently had to work on some JNI stuff and the difference between P/Invoke and JNI is mind-blowing...

    I know about JNA but my understanding is that it could be 10x slower than JNI, which could be a problem if the reason you are calling native code is performance related.

    I guess P/Invoke has an "unfair" advantage in that MS probably knew early on that it had to work well because there would be so much functionality missing in .Net (at least initially) that people would just have to P/Invoke into Win32. Whether that is true or not I don't know, but having this functionality be a first-class citizen is a nice bonus either way.