I have always believed that Debug builds are slower than Release builds since the compiler needs to additionally generate debugger information. I was recently surprised to hear one of my colleagues saying that release builds usually take more time. (I believe that it is only because of incremental linking/compiling).
In general, which of the two is faster?
Well, there are a number of variables that could affect things. Here are some reasons Debug could be faster:
On the whole, I'd expect that a debug build will be faster to build, but slower to run and a release build to take longer to build, but the end result would run faster.
This is down to the release buid probably having more aggressive optimisations and these can interfer with debuggability. Also, some larger-scale optimisations do take a long time. The time to insert debug information in the object files is small enough to be ignorable, it probably takes less time than reading the source code off disk in the first place.
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