不知道你函数的接口是什么样的,几次函数调用。。
以下来自 这篇文章: https://msdn.microsoft.com/en-us/library/ms235282.aspx
PInvoke has an overhead of between 10 and 30 x86 instructions per call. In addition to this fixed cost, marshaling creates additional overhead. There is no marshaling cost between blittable types that have the same representation in managed and unmanaged code. For example, there is no cost to translate between int and Int32.