Size difference (Release/Debug)

Asked

Viewed 1,301 times

3

In Delphi there is Build Configurations (Release and Debug), choosing the Release the size of the executable decreases, I wanted to know what it fails to include in the Release, because the size had a considerable decrease compared to Debug.

  • The difference in size is practically due to the part that the tool debug needs: step-by-step execution, variable value inspection, etc.

2 answers

4


Debug

It is the build form used to debug the application. It will generate a larger executable because of this, because to debug some things, it is necessary to have the reference points of the code.

Release

It is the lean compilation form, where the version that will be made available to the client is generated. It is smaller because we do not need the references.

--

This is the basic difference between the two, but you can individually customize each of them:

inserir a descrição da imagem aqui

This will allow you to do different validations when in Release or Debug using directives.

--

You can even create your own ways where you can add memory leak checks, Code Review, Coverage and various other things:

inserir a descrição da imagem aqui

  • Very good, it is clear, but it can happen that some process works in Debug and does not work the same way in Release?... if it happens would have to add the reference in the Release?

  • Yes, it is possible. But it will depend on your implementation. Even more if you are using the {$IFNDEF DEBUG} and {$IFNDEF RELEASE directives}

  • Yes, but then I’m not sure if what I’m implementing in Debug mode will work in Release?... because it already happened to me that I tested the program in Debug and Release he did not do the same process.

  • As I said, it will depend on your implementation now, if you have not customized anything, the operation should be the same for both. Unless your application depends on some external component (dll/so), and this guy is not present in the place defined, because by default Delphi generates the Release/Debug executables in separate folders.

  • Okay, thanks for your help Victor.

  • when I’m going to release the version to the client by Release, it is necessary to give a Clean before or only compile and then give a Build?

  • I believe that you do not need to give Clean. Clean serves to clean the generated files, such as Dcus, Exes, and so on. Build will always generate these guys and overwrite the old ones.

  • Tranquil, then the right thing would be to compile and then build?

  • The ideal is rum Build All (Shift + F9)

  • Blz, thanks to Victor!

Show 5 more comments

2

By default there are three build settings: Groundwork, Debug and Release.

In the Project Manager, Build Configurations represents Groundwork, the settings of Debug and Release are listed in separate nodes.

inserir a descrição da imagem aqui

You can change the option values in any configuration, including Groundwork. You can delete the settings of Debug and Release, but not Groundwork.

When you compile and save a project, the files are saved in a directory whose name corresponds to the name of the current build configuration. The directories of Debug and Release exist by default, and a directory is created for any active custom build configuration when you save a project.

  • Use the configuration of Debug when the project is in the development phase, where it is necessary to debug the project.

  • Use the configuration of Release when the project is in the final development phase, the version that will be made available to the end user.

About the application size: this is due to configuration of Debug be an extension of Groundwork, but without optimization, thus allowing debugging as well as defining specific syntax options.

The configuration of Release is also an extension of Groundwork, but it does not produce symbolic debugging information, the code is not generated for calls to be made from TRACE and ASSERT, and this causes the size of the executable to be reduced.

See below a comparison between the two settings:

inserir a descrição da imagem aqui Original image here

Sources: 1, 2

Browser other questions tagged

You are not signed in. Login or sign up in order to post.