Skip to content

Performance degradation on many tests #4009

@timcassell

Description

@timcassell

I've been noticing performance degradation when running many tests (thousands in my project) for a while. It's especially noticeable on my long-running tests, but the test times also show degradation on quick tests also.

I have setup and teardowns for every test.

At first I thought it was because I have objects pooling and the pool could be causing a leak and interfering with the performance, but I still see the same degradation with the pool disabled.

image

image

When I run all tests in a group, the last sub-group takes 1.4s. Then when I run just the last sub-group independently, it takes 480ms, nearly 1/3 of the time. The more tests I run at a time, the longer it takes the last test to complete. This is a big problem for me with over 3600 tests, half of them are long-running (the images are only showing the quick tests).

I was using NUnit 3.13.0, and I just updated to NUnit 3.13.2 and saw the same behavior on both versions.

Any ideas?

[Edit] I should add that my library is targeting netstandard2.0, and I'm running the tests in net472 and net5.0 (I see the same degradation in both runtimes).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions