Turn on multithreading to speed up compilation

Source: Internet
Author: User

As the project grows, the time it takes to compile is longer. In order to improve the efficiency of compiling, we can turn on multithreading to improve the speed of compiling, and make full use of the performance of multi-core machine to optimize the compilation.

 1.windows.

Currently we use vs2012 to compile the project under Windows. VS can turn on multi-core compilation in the following ways

First multi-processor compilation selection "Yes (/MP)" in the C/s + + option of the project

Then select "No (/gm-)" in "Enable minimum build" in code generation inside.

Then recompile, you will find that the compilation speed will be improved a lot. 2.linux. Linux we use Qtcreator to compile the project. Qtcreator can turn on multithreaded compilation by first checking how many threads your computer's CPU supports (using virtual machines to see how many processor cores are allocated in the virtual machine settings), and if 8, in the Qtcreator project settings, Add the parameter-j8 to make in the build step as follows:this way, your compilation speed will be greatly improved ^ ^!

Turn on multithreading to speed up compilation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.