5 ms·
Actually, Delphi/ObjectPascal's compilation speed comes mainly from being a one-pass compiler. Code is translated directly to native code per compilation unit,
by lobster_johnson 13y ago
Actually, Delphi/ObjectPascal's compilation speed comes mainly from being a one-pass compiler. Code is translated directly to native code per compilation unit, and since there is no "header file hell", each unit is an independent part whose generated code can be cached in its entirety, so during a single compile, if you have changed just one unit, the compiler only needs to compile that unit (plus dependencies) and then perform linking. The linking is much less complicated, too. Delphi also benefits from having a hand-coded parser and not too many machine code optimizations. I think the simplicity of the grammar may contribute some, but probably very little.