Linux 中二进制文件的加载时间
我总体“感觉”应用程序在 Windows 上的打开速度比在 Linux 上更快。我知道这太模糊/不科学,但如果我要比较应用程序的加载时间,例如 Windows 和 Linux 上的 VLC,我会怎么做?另外,我想研究 Windows 和 Linux 用于二进制文件的加载机制的差异,因此非常感谢任何参考。
I have a general "feeling" that applications open faster on Windows than on Linux. I know this is too vague/non-scientific but if I were to compare load time of an application e.g. VLC on Windows and Linux how would I go about ? Also, I would like to study the differences in loading mechanism used by windows and Linux for binaries so any reference would very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Linux 加载程序可以为您提供大量有关绑定过程的信息。
有关更多详细信息,请参阅 ld.so(8) 手册页。
The Linux loader can give you lots of information about the binding process.
See the
ld.so(8)
man page for more details.要真正测量这一点,您需要能够在测量之前刷新每个操作系统上的文件缓存。
Windows 所做的一件事是在启动后立即开始将常用 DLL 和应用程序的列表加载到文件缓存中。这称为 SuperFetch,效果非常好。
Linux 发行版有时有一个类似的列表,由名为 readahead 的程序预加载到文件缓存中。 Linux 发行版的问题在于,该列表在安装时是固定的,并且不会自动更新,因此它通常只包括默认用户桌面、Web 浏览器、电子邮件应用程序等程序。
刷新 Linux 上的文件缓存,以 root 身份执行以下命令:
要刷新 Windows 上的文件缓存?我不知道,我需要看看。
To really measure this you'd need to be able to flush the file cache on each OS before measuring.
One thing that Windows does is immediately after bootup it begins loading a list of frequently used DLLs and applications into file cache. This is called SuperFetch and it works pretty well.
Linux distros sometimes have a similar list that is preloaded into file cache by a program called readahead. The problem with the Linux distros is that this list is fixed at install time and isn't automatically updated, so it usually only includes programs such as the default user desktop, web browser, email application, etc.
To flush the file cache on Linux, do the following command as root:
To flush the file cache on Windows? I don't know, I will need to look.