Difference between revisions of "Improving Build Times"

From CDOT Wiki
Jump to: navigation, search
 
(Introduction)
Line 14: Line 14:
  
 
Using the value '''4''' is a safe default on most dual core systems.  Even on a single core machine, a value of '''j2''' is a reasonable choice so that make isn't constantly blocked on I/O bound operations.  You can experiment with different numbers of jobs for your particular hardware configuration.
 
Using the value '''4''' is a safe default on most dual core systems.  Even on a single core machine, a value of '''j2''' is a reasonable choice so that make isn't constantly blocked on I/O bound operations.  You can experiment with different numbers of jobs for your particular hardware configuration.
 +
 +
== Suppressing compiler output on the console ==
 +
 +
Normally, make prints a lot of information to the console.  While this information is helpful for debugging compilation errors, it tends to slow down compile time.  You can ask that make suppress this output, to be '''silent''' by means of the '''-s''' switch:
 +
 +
make -s -f client.mk

Revision as of 17:37, 11 February 2008

Introduction

There are a number of things you can do in order to improve build times. These include:

  • Using parallel invocations of make
  • Suppressing compiler output on the console
  • Using a compiler cache

Using parallel invocations of make

While make is set to run a single job serially by default, it able to run multiple jobs in parallel. You tell make to run parallel jobs (in the following example 4 jobs) by adding the following make option to your .mozconfig file:

mk_add_options MOZ_MAKE_FLAGS=-j4

Using the value 4 is a safe default on most dual core systems. Even on a single core machine, a value of j2 is a reasonable choice so that make isn't constantly blocked on I/O bound operations. You can experiment with different numbers of jobs for your particular hardware configuration.

Suppressing compiler output on the console

Normally, make prints a lot of information to the console. While this information is helpful for debugging compilation errors, it tends to slow down compile time. You can ask that make suppress this output, to be silent by means of the -s switch:

make -s -f client.mk