[fpc-pascal] What's in Hello World

Sven Barth pascaldragon at googlemail.com
Sun Jan 7 11:23:39 CET 2024


Am 07.01.2024 um 10:01 schrieb Florian Klämpfl via fpc-pascal:
>
>
>> Am 06.01.2024 um 20:05 schrieb Matthew Phillips via fpc-pascal 
>> <fpc-pascal at lists.freepascal.org>:
>>
>> I compiled the Hello World program from the docs and noticed that it's
>> 435k. Compared to a lot of newer languages, like Golang, that's not bad
>> at all.
>>
>> I then compiled the equivalent C program with gcc which came out at
>> 33k. So I'm just curious, where does the difference comes from?
>> Could it be that fpc is including some parts that are not being used in
>> this simple of a program or is more going on?
>
> https://wiki.freepascal.org/Size_Matters
>
To underline this with some numbers (I assume you mean the 
demo/text/hello.pp which only contains a mere "Writeln('Hello World')" 
and no additional units; all tests on x86_64-linux with 3.3.1):

- FPC compiled as is: 388976 B
- FPC compiled with full smartlinking: 55920 B
- FPC compiled with C linkage: 388760 B
- FPC compiled with full smartlinking and C linkage: 56792 B

(gotta admit, the last one surprised me though ^^')

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20240107/95819880/attachment.htm>


More information about the fpc-pascal mailing list