Skip to content

cmd/dist: support configurable number of build jobs #6799

Description

@davecheney
Problem statement:

Currently cmd/dist uses hard coded defaults for the number of concurrent jobs to execute
during the early stages of ./make.bash; up to the point of go_bootstrap taking over.

This number is 1 on arm machines and 4 everywhere else. For arm specifically this value
used to be correct 3 years ago but now dual and quad core arm host are available this
unnecessarily delays an already slow c compilation phase.

This value can be easily changed after checkout, but as the builders always build from a
clean tree this is not an option.

It may also be for large x86 machines the value of 4 parallel jobs is too conservative,
or to high if operating in a virtualised environment, however this is not the main focus
of this proposal.

Implementation:

I propose to add a new flag cmd/dist which would override the default value. If not set
the current defaults of 4 (or 1 for arm) would apply.

The proposed name of this flag is -j.

This flag would also need to be passed through from the builder command via the existing
GO_DISTFLAGS env var.

Builder owners can set GO_DISTFLAGS to control the number of parallel jobs during the
build allowing them to improve build times.

Once the build arrives at go_bootstrap the current behaviour of running runtime.NumCPU()
jobs would take over. This does not change as part of this proposal.

See also: https://groups.google.com/d/msg/golang-dev/GjhQspYudHk/vNVFsd_49AEJ

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions