Skip to content

Conversation

@janl
Copy link
Member

@janl janl commented Dec 6, 2025

merge after #5808

benefits measured on my M1 Pro Mac Mini (10 performance + 4 efficiency cores):

-j1
real   11m43.254s
user   7m6.541s
sys	   3m29.107s

-j4
real   3m44.584s
user   7m39.293s
sys    5m23.305s

-j6
real   2m48.494s
user   7m41.564s
sys    6m0.097s

janl added 10 commits December 4, 2025 10:40
This is in preparation for using parallel make features.

Since both .PHONY couch and src/couch exist, the parallising
of src/* would clobber the top level .PHONY couch target.
When called with -jN for N>1, make will run `rebar -r eunit` for
all src/* Erlang apps (without the default skipped ones) up to the
limit of N times in parallel.

This is best used with GNU Make, as it allows for controlling the
output of each subtask to be grouped. BSD Make has no such feature
and interleaves all parallel target’s output, making it hard to
read.

For example:

    gmake -j2 --output-sync=target

will run two test suites in parallel and keep their respective
outputs separated. It does this by buffering all output before a
task is done that means for the first few tests, you don’t see
output as you do with serial execution.

On my machine I can run up to -j6 relatively stable, making use
of all 14 cores. Beyond that, Spurious errors can occur. I’ll
file those separately.

-j2 shows an almost 2x speed improvement, as expected and things
scale relatively linarly up until ~2.5 minutes of runtime, which
seems to be a lower bound with all our various setup and wait
bits.

For comparison, -j1, that is serial execution takes about 10.5
minutes on this machine.

Use with care in CI, but definitely use on your local dev machine.
This is achived by configuring each couch_server launched
with separate etc, data and log directories. These directories
are cleaned up after successful test runs.
@janl janl marked this pull request as draft December 6, 2025 10:01
@janl janl marked this pull request as ready for review December 8, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant