Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Shake 文档中,它建议使用该标志进行编译-with-rtsopts=-I0以禁用空闲垃圾收集。为什么Shake建议这样做?
-with-rtsopts=-I0
默认情况下(不带标志)如果所有 Haskell 线程空闲 0.3 秒,GHC 将执行垃圾回收 (GC)。由于构建系统定期运行外部进程,因此所有 Haskell 线程空闲超过 0.3 秒是很常见的,这会导致大量不必要的垃圾收集。由于机器很可能从 Shake 正在运行的进程中完全加载,因此 GC 将占用原本可以做有用工作的时间。如果 GC 运行多线程,问题会更加严重。