[Lazarus] Large program size - 1.8 MB for empty GUI project

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Apr 8 22:38:28 CEST 2009


Reenen Laurie schrieb:

>> Just a note: some people think that units can be compiled in one pass -
>> this is not true. The compiler must stop on every Uses clause, and
> 
> So .exe's should be (much) smaller if your uses units are put mostly
> in implementation

No, that's not related at all.


> If we have to do multipass why is it necessary to have a distinction
> at all?

The compiler must know where to stop pass 1 - and that place is the 
begin of the implementation section. When the interface section uses 
definitions from other units, all these units must become part of the 
interface uses clause, so that the compiler can compile these units before.

The distinction between interface and implementation also allows to 
recompile only selected units. When only the implementation section of a 
unit changes, it's sufficient to recompile only that unit. When the 
interface part changes, also all those units must be recompiled, which 
use that unit.

DoDi




More information about the Lazarus mailing list