Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Signing an exe makes the communication slow?

Scenario

I have a C# executable, signed using strong key. From this C# application I'm invoking C++ execuatbles(Which are not signed), using 'pinvoke'. I observe there is significant delay in the exceution of the C++ executables. Is there any reason for this?

like image 886
Rahul Raj Avatar asked Nov 14 '22 10:11

Rahul Raj


1 Answers

Please, refer the neighbor answer at How do I strongly name an Unmanaged C++ Dll

In general, strong name for assembly, is only a checksum, that nobody has changed/hacked/injected into your code (injection could be something like virus or trojan app). It is not very safe protection of code, that's why it does not need a lot of time to complete all tests on assembly. Surely, signed code, will take a bit more time to be loaded, than simple assembly.

On the other hand, PInvoke, is like a web-service call, where .Net code don't mind if that code is safe or not. Here delays could be only if you have many arguments, and argument types are coming with some 3rd party structures from some big signed assemblies. And here you may see some little time delays, because those big assembly is loaded into memory, types are checked, and PInvoke is made.

Maybe, you should try to move all classes and structures from many assemblies into one, and use there PInvoke. So, in this case, you will not need to load many assemblies.

like image 126
Oleksii G. Avatar answered Nov 16 '22 04:11

Oleksii G.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!