Does exe sign a slow message?

Scenario

I have a C # executable signed with a strong key. From this C # application, I call C ++ execuatbles (which are not signed) using "pinvoke". I observe that there is a significant delay in the execution of C ++ executables. Is there a reason for this?

+6
source share
1 answer

Please refer to neighbor's answer in What can I call unmanaged C ++ Dll

In general, the strong name for the assembly is only a checksum that no one has changed / cracked / entered into your code (the injection can be something like a virus or a Trojan application). This is not very secure code protection, so it does not take a lot of time to complete all assembly tests. Of course, a signed code will take a little longer to load than a simple build.

PInvoke, on the other hand, is like a web service call, where the .Net code doesn't mind if this code is safe or not. There may be delays here only if you have a lot of arguments, and the argument types come with some third-party structures from some large signed assemblies. And here you can see slight time delays, because this large assembly is loaded into memory, types are checked, and PInvoke is done.

Perhaps you should try to move all classes and structures from many assemblies to one and use PInvoke there. Thus, in this case, you will not need to download many assemblies.

+1
source

Source: https://habr.com/ru/post/907820/


All Articles