如何加快linux中的编译时间 [英] How to speed up compilation time in linux

查看:294
本文介绍了如何加快linux中的编译时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在linux下编译时,我使用标志-j16,因为我有16个内核。我只是想知道如果使用sth像-j32有任何意义。实际上,这是一个关于处理器时间的调度,如果可能比任何其他这种方式(特别是我想喜欢pararell编译每个与-j16,如果一个将是-j32?)对特定的进程压力更大。 。
我认为这没有什么意义,但我不知道如何内核解决这样的事情。

While compiling under linux I use flag -j16 as i have 16 cores. I am just wondering if it makes any sense to use sth like -j32. Actually this is a quesiton about scheduling of processor time and if it is possible to put more pressure on particular process than any other this way (let say i have like to pararell compilations each with -j16 and what if one would be -j32?). I think it does not make much sense but I am not sure as do not know how kernel solves such things.

关心,

推荐答案

我使用一个基于GNU make的非递归构建系统,我想知道它的扩展性。

I use a non-recursive build system based on GNU make and I was wondering how well it scales.

我在具有超线程的6核Intel CPU上运行基准测试。我使用 -j1 -j20 测量编译时间。对于每个 -j 选项 make 运行三次并记录最短时间。使用 -j9 导致最短的编译时间,比 -j6 高11%。

I ran benchmarks on a 6-core Intel CPU with hyper-threading. I measured compile times using -j1 to -j20. For each -j option make ran three times and the shortest time was recorded. Using -j9 results in shortest compile time, 11% better than -j6.

换句话说,超线程确实有所帮助,而具有超线程的英特尔处理器的最佳公式为 number_of_cores * 1.5

In other words, hyper-threading does help a little, and an optimal formula for Intel processors with hyper-threading is number_of_cores * 1.5:

图表数据在这里

这篇关于如何加快linux中的编译时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆