2

What effect do the options in the image below have on the finally binary?

enter image description here

I first compiled my application with them enabled and the compiled binary file size was 7,606,272 bytes. Then I manually switched them off...and the size was unchanged. I also used these compiler switches (included in every file using a .inc file) to do the same thing:

    {$D-}       // Remove "Debug information"
    {$L-}       // Remove "Local symbols"
    {$Y-}       // Remove "Reference info/Definitions only"
    {$C-}       // Remove "Assertions"

Same file size. The help does say that debugging information goes into the DCU (object) files and I've confirmed this is correct (they're smaller with the options off). Compilation and linking time is so fast, though, its hard to tell if there is a difference time-wise.

Does toggling these options have any effect on the final binary (eg. performance enhancement)? It doesn't appear to affect the size of the binary, in any case.

7
  • 1
    Are you sure that this information is not present in the help? Commented Jul 24, 2015 at 14:51
  • @LURD: The help does say that debug information goes into the DCU (object) files (I'll add that to the question, thanks). I have confirmed that the DCU files are indeed smaller with debug information compiled out. Compilation and linking is so quick that I can't see any time difference. The help is silent about what effect (if any) these options have on the final binary, hence the question. Commented Jul 24, 2015 at 14:58
  • In modern delphi help, it says that it does not affect the final exe file size. Commented Jul 24, 2015 at 15:00
  • @LURD: Aah, thanks. Does that mean there is zero benefit to switching these options off for RELEASE code? Commented Jul 24, 2015 at 15:03
  • 1
    Just a link to help, docwiki.embarcadero.com/RADStudio/en/… Commented Jul 24, 2015 at 15:04

1 Answer 1

3

The top three options have no effect on the binary. They only impact on whether or not debugging information is produced in the dcu files.

The assertions option determines whether or not Assert statements are included or not. That affects the executable.

Debug DCUs determines whether or not the RTL/VCL dcu files contain debug information. Also, the debug versions of these dcu files are built unoptimized to make debugging better. So that also affects the code that goes in the executable.

Sign up to request clarification or add additional context in comments.

3 Comments

Ok, thanks. The in-built help with Delphi-7 was missing the critical bit "does not affect the size or speed of the executable program", see the comment from LU RD.
My release build includes debug info so that I can get good post mortem debugging info.
Good point. Including the debug information also allows one to set breakpoints and step through any {$IFDEF NDEBUG} code, though I have very little code specific to NDEBUG and anyway do most debugging in DEBUG code. If the NDEBUG application were to crash (away from the development machine), does having the debug information help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.