Debug size compared to dll version

Why is there more in cpp dll in X10 debugging mode than release in .Net, are they almost the same size?

+3
source share
4 answers

To debug a C ++ program, additional information must be stored in the DLL so that the debugger can learn about the code at runtime. C ++ does not require runtime in order to be able to check the code, unlike C #, which allows for extensive runtime control, also known as reflection. This information is in C # using debug or release mode.

In addition, C ++ is usually compiled directly into machine code in release mode, the goal of the compiler is to optimize the code as much as possible, for example. delete any and all extraneous information and code. In C #, the compiler is compiled into pseudocode, which just in time compiles as needed. This code saves much of what is required for debugging, regardless of whether it is the release or debugging you are creating. So much so that you can write a decompiler to give you the code back from the runtime assembly.

+3
source

Perhaps because .Net is a runtime mechanism that handles all debugging checks, while in CPP all checks are compiled into a DLL.

+1
source

.Net DLL , , . , PDB, .

, ++, , op-ops .

+1
source

You mean C # is not .NET. It also depends on your project.

I have one C ++ / CLI DLL that is 54K in release and 94K in debug,
and the other is 88K in release and 124K in debug.

My C ++ / CLI EXE, which includes MFC, is 471 KB in version and 4446 KB in debugging!

And then my C # DLL is 135K in debugging and release.

0
source

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


All Articles