Why in cpp a dll in debug mode is X10 bigger than release while in .Net they are almost the same size?
To Debug a C++ program alot of extra information has to be kept in the DLL so the debugger can find out about the code at run-time. C++ has no run-time requirement to be able to inspect the code unlike C# which allows for extensive run-time inspection also known as reflection. This information is there in C# whether using debug or release mode.
Additionally C++ is usually compiled directly to machine code in release mode the objective of the compiler is to optimized the code as much as possible, eg. remove any and all extraneous information and code. In C# the compiler compiles to a pseudo code which is just in time compiled as required. This code keeps much of what is required for debugging regardless if it is release or debug that you are building. So much so that it is possible to write a de-compiler to give you the code back from a run-time assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With