Skip to content

Improve performance of parallel discovery #3647

Closed

Description

Currently sequential discovery of tests with MaxCpuCount = 1 is faster than parallel discovery (MaxCpuCount = 0) for test assemblies that only contain a few (100) tests. This is because -

  1. Sequential discovery reuses the same testhost process to discover all supplied test sources. Parallel discovery on the other hand creates a new testhost process for every supplied test source. The overhead of process startup, extension loading etc. is significantly greater than the time required to discover a few (100) tests in this case. Sharing / reusing each teshost processes to discover more than one test source over the lifetime of the discovery operation should improve performance significantly.

  2. The testshost processes for parallel discovery are started on a staggered basis and the actual number of testhosts running at any point is always (significantly) smaller than the specified MaxCpuCount. Starting the max allowed number of testhost processes up front should help to better amortize the startup time overhead for individual processes.

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions