Chinaunix

标题: make -j n 性能测试 [打印本页]

作者: fender0107401    时间: 2016-02-23 21:46
标题: make -j n 性能测试
本帖最后由 fender0107401 于 2016-02-23 21:51 编辑

测试方法

用在Debian GNU/Linux下面便宜GNU Octave。

测试系统

OS   Debian 8.0 AMD64 Stable
CPU  Intel I3 4170
MAKE GNU Make

> make -v
GNU Make 4.0
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.



测试结果
time make
real        24m25.219s
user        23m7.528s
sys        0m38.548s

time make -j 2
real        14m4.818s
user        26m19.948s
sys        0m44.780s

time make -j 4
real        11m28.407s
user        42m24.484s
sys        1m6.820s

作者: evaspring    时间: 2016-02-24 14:41
怎么感觉时间还更多了 ?

不过说实话 我觉得 -j 一定要在CPU核心数多于8的情况下才有明显的提升 不然其他程序会抢CPU的使用
作者: hellioncu    时间: 2016-02-24 15:46
咱的项目没那么大,最多几十秒搞定,不纠结
作者: fender0107401    时间: 2016-02-24 15:56
我这边的项目是C++写的,用了很多Boost。

如果是单线程编译的话(debian i3 clang++,换成i5也差不多)需要20分钟左右。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2