Skip to content

build: investigate jumbo builds #18742

@bnoordhuis

Description

@bnoordhuis

A jumbo build concatenates compilation units into a single file before compiling. E.g.:

$ cat $all_sources > all.cc && c++ all.cc

It trades build parallelism and memory consumption for:

  1. Usually better generated code; kind of a poor man's LTO.
  2. CPU time. Because the compiler has to parse headers only once, it's often dramatically faster.

V8 in particular is a good candidate and already supports jumbo builds. To illustrate:

  1. V8, clean normal build, make -j8: 6:30m wall clock time, 47:48m cpu time
  2. V8, clean jumbo build, make -j1: 4:37m wall clock time, 4:34m cpu time

That's not a typo! On my machine it's 33% faster in human time and a whopping 10x faster in cpu time.

The one downside is that it needs a lot of memory. Without sharding you probably shouldn't try this on a machine with less than 8 GB RAM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions