Skip to content

Default concurrency #966

@sindresorhus

Description

@sindresorhus

In #791, we added a flag to control the concurrency. It turned out operating systems are really bad at doing their job properly, and they couldn't handle the amount of processes we tried to start up when there's a lot of test files. We also have the overhead starting up node and requiring dependencies in each process. This was a big problem in React projects where you do one test file per component, and you usually have a lot of components.

We should consider doing a default concurrency limit. Users should still be able to set it to unlimited, but I think it would be in our best interest to adapt to reality. I've previously had good success with (os.cpus().length || 1) * 2, but we should get some real numbers on it from various systems.

Everyone, please run your test suite with the --concurrency flag and try out different numbers for it and post back the results. Also include the number of test files in the suite and the output of:

Edit: Let's wait on this until #945 is merged and released, per #966 (comment).

node -p "require('os').cpus().length"

@avajs/core Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions