make -j{cpu core#} 를 통해 Makefild에서 정의한 컴파일을 보다 빠르게 할 수 있습니다.
원리는 병렬적으로(parallel, not interleaving) 컴파일을 수행하여서 멀티코어의 이점을 살리는 것!
ex) 4코어 시스템이라면 make -j4
더 찾아보니 코어 수의 20% upperbound 로 매개변수를 잡는 것이 가장 좋은 성능을 낸다고 합니다.
8코어라면 8*1.2의 올림인 10 -> make -j10
또한 가상코어(쓰레드)가 실제코어 수보다 크다면 가상코어 수를 매개변수의 기준으로 잡으면 됩니다.
아래는 make의 j옵션 매개변수에 대해 찾아보며 도움이 됐던 게시글
How to determine the maximum number to pass to make -j option?
I want to compile as fast as possible. Go figure. And would like to automate the choice of the number following the -j option. How can I programmatically choose that value, e.g. in a shell scrip...
unix.stackexchange.com
https://m.blog.naver.com/CommentList.nhn?blogId=invain&logNo=80094907942
Geunsik Lim's BLOG : 네이버 블로그
http://leemgs.fedorapeople.org
blog.naver.com
'개발 > 유지보수' 카테고리의 다른 글
[Linux Ubunut] bash에서 Tab키 자동완성 기능 켜기 (0) | 2021.06.17 |
---|---|
[Docker] docker image build error: " returned a non-zero code: 100 " (0) | 2021.06.17 |
[Vim] 에디터에서 전체 라인 정렬하기 (0) | 2021.06.17 |
[Linux] 편하게 디렉토리 이동하기 위한 명령어 (0) | 2021.06.17 |
[Linux] ll 입력으로 ls -al과 같은 결과보기 (0) | 2021.06.17 |