DEV Community

loading...

Discussion on: Executable Size: Rust, Go, C, and C++

Collapse
kornelski profile image
Kornel

It doesn't give you any understanding of runtime size, because you've compiled in debug mode.

In debug mode compilers intentionally generate bloated code to be easy on debuggers, and add debug information. Precise debug information is generally a good thing, but it's very large.

For a comparison of runtime/stdlib overhead, you should compile in release mode, and then strip the executables. It would be wise to also use LTO (dead code elimination).

Collapse
aakatev profile image
Artem Author • Edited

Good point! I should have compared stripped versions too.