- 1、本文档共8页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
- coreldraw题库(coreldraw题库).doc
- 图表统计在应用问题教学中的尝试(The attempt of chart statistics in the teaching of applied problems).doc
- 图解系列(Graphic series).doc
- 圆的面积---邱子珍(The area of the circle --- Qiu Zizhen).doc
- 土壤污染(soil pollution).doc
- 土建施工员应该知道的数据(The data that the builder should know).doc
- 土建管理(Civil Engineering Management).doc
- 土楼(Tulou).doc
- 土豆的营养价值(The nutritional value of potatoes).doc
- 圣典(Canon).doc
- 2025年贵阳职业技术学院单招职业倾向性考试题库及答案1套.docx
- 2025年贵阳职业技术学院单招职业倾向性测试题库最新.docx
- 2025年贵阳职业技术学院单招职业倾向性考试题库推荐.docx
- 2025年贵阳职业技术学院单招职业技能测试题库附答案.docx
- 2025年贵阳职业技术学院单招职业倾向性测试题库附答案.docx
- 2025年贵阳职业技术学院单招职业技能测试题库及答案1套.docx
- 2025年贵阳职业技术学院单招职业技能测试题库必考题.docx
- 2025年贵阳职业技术学院单招职业技能考试题库附答案.docx
- 车辆转让协议简单样板375字6篇.docx
- 2025年贵阳职业技术学院单招职业倾向性测试题库必考题.docx
文档评论(0)