网站大量收购独家精品文档,联系QQ:2885784924

linux下提高编译速度很好(Linux to improve, compile speed is very good).doc

linux下提高编译速度很好(Linux to improve, compile speed is very good).doc

  1. 1、本文档共8页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
linux下提高编译速度很好(Linux to improve, compile speed is very good)

linux下提高编译速度很好(Linux to improve, compile speed is very good) As the project grows, its a waste of time to recompile the entire project each time. Research, look for the following ways to help speed up. TMPFS Some people say that using RAMDisk in Windows reduces the compile time of a project from 4.5 hours to 5 minutes, Maybe this number is a bit exaggerated, but think about it, putting files into memory should be much faster than compiling them on disk, Especially if the compiler needs to generate a lot of temporary files. This method of implementation costs the lowest, in Linux, direct mount, a TMPFS on it. There is no requirement for the compiled project, and the compiler environment is not changed. Mount, -t, TMPFS, TMPFS, ~/build, -o, size=1G Use 2.6.32.2s Linux Kernel to test the compile speed: Physical disk: 40 minutes and 16 seconds Use tmpfs:39 for 56 seconds Eh Nothing much has changed. It seems that compilation is slow and largely bottleneck is not on top of IO. But for an actual project, there may be a IO intensive operation such as packaging during the compilation process, so long as possible, Using TMPFS is good and harmless. Of course, for large projects, you need to have enough memory to be able to afford the TMPFS overhead. Make -j Since IO is not a bottleneck, CPU should be an important factor that affects the speed of compilation. Using make -j with one parameter, you can compile the project in parallel, for example on a dual core machine, You can use make -j4 at best to allow make to execute at most 4 compile commands, so that you can make better use of CPU resources. Or do you test with Kernel?: Use make:40 for 16 seconds Use make -j4:23 for 16 seconds Use make -j8:22 for 59 seconds From this point of view, proper parallel compilation on multicore CPU can significantly increase compilation speed. But the parallel task should not be too much. It is usually two times the core number of CPU. However, this scheme is not completely without cost, and i

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档