[fpc-pascal] "Hello world" syscalls

Vojtěch Čihák vojtech.cihak at atlas.cz
Tue Jan 7 02:28:23 CET 2020


Hi,
 
I found this article: https://drewdevault.com/2020/01/04/Slow.html
but FPC is missing, so I wrote simple:
 
program Project1;
begin
  writeln('Hello world!');
end. 
 
$ fpc -O3 -XX Project1.pas
 
$ strace -C ./Project1
 
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 30.83    0.000037          37         1           readlink
 25.83    0.000031           8         4           ioctl
 18.33    0.000022          22         1           write
 17.50    0.000021           5         4           rt_sigaction
  4.17    0.000005           5         1           getrlimit
  3.33    0.000004           4         1           execve
------ ----------- ----------- --------- --------- ----------------
100.00    0.000120                    12           total
 
It results in 30kB binary, 12 syscalls total, 6 unique. IMO appropriate.
Has the fact that strings are managed types some relevance here?
 
Thanks, Vojtěch.


(FPC 3.0.4)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200107/c14577c9/attachment.html>


More information about the fpc-pascal mailing list