使用-jN
编译会编译得更快,因为它同时编译多个部分。但 GCC 文档说(虽然我找不到确切的链接)使用 -j1
编译将产生更好的优化二进制文件。
您能解释一下使用 -j1
进行编译的所有好处吗?您甚至可以提供一个小的 POC 来证明使用 -j1
进行编译会生成比 -jN
更优化(在性能方面)的二进制文件吗?
最佳答案
-j 选项用于 make。 gcc 没有这样的选项
我认为您正在谈论 -O 选项。
这是 -O1 的手册页
-O1 Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function. With -O, the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time.
关于c++ - 使用-j1而不是-jN编译有什么好处,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30525172/