Delphi compiler settings
First things first – before you start meddling with the code, you should check the Delphi compiler settings for your project. In some situations, they can affect code speed quite a lot.
To check and possibly change compiler settings, open your project, and then select Project | Options from the menu or press Ctrl + Shift + F11. Relevant options can be found in Building | Delphi Compiler | Compiling, as shown in the following screenshot:
Figure 5.1 – Compiler settings that influence program speed
We will look at the following options:
- Code inlining control
- Optimization
- Record field alignment
- Assertions
- Overflow checking
- Range checking
All of these settings can be enabled/disabled for an entire project, and they can also be turned on/off in the code by using compiler directives (comments that start with {$
).
Code inlining control
We will look into the concept of code inlining...