为什么MSYS中的configure这么慢?

发布于 2024-08-21 13:17:21 字数 155 浏览 10 评论 0原文

当我使用 MSYS 编译某些内容时,./configure 步骤可能比 make 花费更长的时间。然而,同样的过程在Linux中configure速度快,make速度慢。这是否只是 MSYS 中的某些设置导致我的系统陷入困境?有人有解决办法吗?

When I use MSYS to compile something, the ./configure step can take longer than the make. However, the same process in Linux has a fast configure and slow make. Is this just some setting in MSYS that is bogging down my system? Does anyone have a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

晨曦÷微暖 2024-08-28 13:17:21

典型的配置脚本会启动很多小型子进程。在类 Unix 操作系统上,这是通过 fork() 和 exec() 函数调用完成的,它们具有需要保留的非常特殊的语义(例如,分叉后的写时复制共享内存)。在 Windows 上,子进程是使用 CreateProcess() 创建的,它具有非常不同的语义(例如,与父进程完全分离的内存空间)。为了正确执行类 Unix 的脚本和程序,MSYS 需要做大量的模拟工作,使得在 Windows 上创建新进程就像 Unix 上的 fork()/exec() 一样。这最终会比本地提供这些函数调用的操作系统慢。

Typical configure scripts do a lot of starting small subprocesses. On Unix-like operating systems, this is done with the fork() and exec() function calls, which have very particular semantics that need to be preserved (for example, copy-on-write shared memory after forking). On Windows, subprocesses are created with CreateProcess() which has very different semantics (eg. completely separate memory space from the parent). In order to execute Unix-like scripts and programs correctly, MSYS needs to do a lot of emulation work to make creating new processes on Windows work like fork()/exec() on Unix. This ends up being slower than an OS that offers those function calls natively.

成熟稳重的好男人 2024-08-28 13:17:21

您可能还想关闭正在运行的所有病毒扫描程序。他们将在每次加载可执行文件时重新扫描它,这绝对会降低脚本性能。

即使您没有运行防病毒软件,也不要忘记 Windows Defender。 (您可能还想禁用用户帐户控制,尽管我不知道这对程序加载时间有什么影响。)

You may also want to turn off any virus scanners you have running. They will re-scan an executable every time it is loaded, which absolutely kills script performance.

Even if you don't have anti-virus running, don't forget about Windows Defender. (You may also want to disable User Account Control, though I don't know what impact that has on program load time.)

妥活 2024-08-28 13:17:21

涉及大量磁盘访问,恕我直言,这会大大减慢速度。
例如,configure 创建临时源代码,作为其执行的测试的一部分进行编译。这会创建一个必须再次删除的目标文件。
为了加快配置速度,我所做的就是提取我想要在 RAM 驱动器上构建的源代码,并在那里配置和编译它。
我建议使用免费的 ImDisk (http://www.ltr-data.se/opencode.html/#ImDisk)。

A lot of disk access is involved, which IMHO slows things down a lot.
For example configure creates temporary source code to be compiled as part of the tests it performs. This creates an object file that has to be deleted again.
What I do to speed up configure is extract the source I want to build on a RAM drive and configure and compile it there.
I recommend using ImDisk (http://www.ltr-data.se/opencode.html/#ImDisk) which is free.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文