4 ms·
I would need further digging to be sure, but my guess would be this: First, Free Pascal being an older language, it should have a relatively lightweight startu
by stncls 3y ago
I would need further digging to be sure, but my guess would be this:
First, Free Pascal being an older language, it should have a relatively lightweight startup, by which I mean closer to C than Go (garbage collection) or C++ (exceptions? standard library constructors?), among compiled languages.
Now why is it so much faster than C? My bet is that it is because the Free Pascal Compiler performs static linking by default [1]. Therefore, no invokation of ld.so and no shared object lookup. Those all involve syscalls and filesystem interactions.
[1] https://wiki.freepascal.org/Lazarus/FPC_Libraries#:~:text=General-,Static%20linking,packages%20into%20one%20big%20executable https://wiki.freepascal.org/Lazarus/FPC_Libraries#:~:text=Ge....
- pestatije 3y agoalso Pascal is notorious for its single-pass source code parsing