Delphi FAQ: Ways to improve compile speed - ideasawakened/DelphiKB GitHub Wiki
Marco Cantu has a definitive blog post on this topic from December 2022: Some Suggestions to Help the Delphi Compiler Post saved to the WebArchive
- Invalid paths cause repeated lookup failures
- Small app test with invalid path 40.3 seconds, fixed paths: 1.7 seconds
- Local SSD / NVMe drives suggested for large increase in compiling speed
- Aliases add extra work to the compiler, penalty is small but best not to use aliases
- No longer part of new projects, but was common in old code
WinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE
- Can generate a massive amount of file lookup work - always use fully scoped unit name references
- See RSP-18130
- Snapshot RSP-18130.pdf
- RSP-18130.DCU-Lookup.zip
- One of the most critical issues
- Reorganizing uses statements to avoid circular references has reduced some projects compilation time 90%
- Create shared instances of generic types whenever possible.
- Example: Create type
TListOfStrings = TList<string>;
and use TListOfStrings instead of defining the same generic type in multiple units
-
Two comments to get some improvement by:
Tools > Options > IDE > Compiling and Running > disable "Show compiler progress"
-
Also see Delphi: How to organize source code to increase compiler performance?