GNU make: should the number of jobs equal the number of CPU cores in a system?

后端 未结 10 1061
长情又很酷
长情又很酷 2020-12-07 10:13

There seems to be some controversy on whether the number of jobs in GNU make is supposed to be equal to the number of cores, or if you can optimize the build time by adding

10条回答
  •  爱一瞬间的悲伤
    2020-12-07 11:04

    YES! On my 3950x, I run -j32 and it saves hours of compile time! I can still watch youtube, browse the web, etc. during compile without any difference. The processor isn't always pegged even with a 1TB 970 PRO nvme or 1TB Auros Gen4 nvme and 64GB of 3200C14. Even when it is, I don't notice UI wise. I plan on testing with -j48 in the near future on some big upcoming projects. I expect, as you probably do, to see some impressive improvement. Those still with a quad-core might not get the same gains....

    Linus himself just upgraded to a 3970x and you can bet your bottom dollar, he is at least running -j64.

提交回复
热议问题