TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Anyone know why Free Pascal's startup is so fast?

3 点作者 Decabytes超过 1 年前
I came across this benchmark https://github.com/bdrung/startup-time and I was absolutely blown away by how fast Free Pascal's startup is. Between that and the numbers FP put up in memory usage in https://thenewstack.io/which-programming-languages-use-the-least-electricity/ I'm curious to give the language a go

1 comment

stncls超过 1 年前
I would need further digging to be sure, but my guess would be this:<p>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.<p>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.<p>[1] <a href="https:&#x2F;&#x2F;wiki.freepascal.org&#x2F;Lazarus&#x2F;FPC_Libraries#:~:text=General-,Static%20linking,packages%20into%20one%20big%20executable" rel="nofollow noreferrer">https:&#x2F;&#x2F;wiki.freepascal.org&#x2F;Lazarus&#x2F;FPC_Libraries#:~:text=Ge...</a>.
评论 #37312174 未加载