Skip to content

Performance regression in v0.50.0 #2756

@PhilippNaused

Description

@PhilippNaused
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <PublishAot>true</PublishAot>
    <TrimmerSingleWarn>false</TrimmerSingleWarn>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="TUnit" Version="0.50.0" />
  </ItemGroup>
</Project>
class Tests
{
    [Test]
    [MethodDataSource(nameof(Ints))]
    public async Task Test1(int i)
    {
        await Assert.That(i).IsGreaterThan(0);
    }

    public static IEnumerable<int> Ints() => Enumerable.Range(1, 10000);
}

Build with dotnet publish --use-current-runtime and then run the output executable.

In v0.25.21 the test duration was about 190ms, in v0.50.0 it takes about 350ms.

I also get performance differences without AOT, but using it makes it more noticeable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions