Tips for efficiency

weixin_38081679 2019-09-19 11:39:37
1. make use of multi-core CPU:     if you have multi-core CPU, you can speed-up compiling of your code by doing the following:      make -j4 (if you have 2-core CPU) or      make -j5 (if you have 3-core CPU) or      make -j6 (if you have 4-core CPU)This is parallel compiling on one computer. To determine the number of cores in your CPU, use the following command      cat /proc/cpuinfo | grep processor | wc -lI define it in my shell as     alias numcpu='cat /proc/cpuinfo | grep processor | wc -l'2. use ccache    ccache can be installed on Ubuntu with      sudo apt-get install ccacheAfter this is done, make changes in the Makefile likeCC      = ccache gccCXX      = ccache g++When the code is recompiled, you will see clear speed-up.
...全文
18 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

473

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧