summaryrefslogtreecommitdiff
path: root/README.pump
blob: c302ec7e339fb0ba6e18dd544b0894820ce62e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
See README for basic information on distcc.

Distcc's "pump" mode improves on plain distcc by distributing not only
compilation but also preprocessing to distcc servers.

The pump mode uses an include server process that exists during
the build. The include server parses and analyzes source and
header files. It runs on the workstation that initiates the build.
The include server analyzes each header file only a few times,
sometimes just once. In contrast, ordinary distcc invokes the
preprocessor hundreds of times on average for each header file of a
large build.

With the pump mode, a static analysis algorithm inspects includes
and computes their possible values according to an overapproximation
semantics. The resulting dependency graph among header files is stored
in the include server, which then acts as a cache for include
analysis.

The include server compresses source files into a temporary directory
as they are encountered. In this way, a given source file is
compressed only once during the build.

It may happen that a header file is included via an absolutely
specified include directory such as -I/absolute/path. But on the
compilation server the path -I/absolute/path does not exist; instead
the server places foo.h under /server_temporary_path/absolute/path for
some /server_temporary_path root directory. This directory has no
meaning on the workstation. Before compressing foo.h, the include
server therefore inserts a #line directive in foo.h, to inform the
preprocessor that the real location is /absolute/path.

The distcc-pump client asks the include server for the list of
compressed files that constitute the transitive closure of the source
file to be compiled. It then spools these files to a distcc-pump
server. The distcc-pump server unpacks these files in the
/server_temporary_path directory before preprocessing and compiling.
The server also rewrites include options, such as -I's, to reflect the
new locations of the files on the server. The .d and the .o files are
both returned to the distcc-pump client.

The pump mode is able to distribute compilations up to 10X faster than
plain distcc. But because building also involves linking and perhaps
generation of source files, the overall speed-up of the build time is
variable.

The distcc-pump was developed to be used with large clusters of distcc
servers, providing hundreds of CPUs. With versions of gcc >= 4.1.1,
the distcc-pump will probably not show major performance gains using
clusters of less than ten CPUs. The preprocessor running on the
workstation is fast enough to keep that many machines busy.