DllImport or LoadLibrary for best performance

后端 未结 4 1593
温柔的废话
温柔的废话 2020-12-30 12:09

I have external .DLL file with fast assembler code inside. What is the best way to call functions in this .DLL file to get best performance?

4条回答
  •  借酒劲吻你
    2020-12-30 12:43

    I think DLLImport and LoadLibrary have different goals. If you use native .dll, you should use DllImport. If you use .NET assembly, you should use LoadAssembly.

    Actually, you can dynamically load native assembly too, see this example: dynamically-calling-an-unmanaged-dll-from-.net

提交回复
热议问题