Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/speed-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
run: dotnet build -c Release
working-directory: "tools/speed-comparison/MSTestTimer"

- name: Run Pipeline
- name: Run Benchmark
run: dotnet run -c Release
working-directory: "tools/speed-comparison/TUnit.SpeedComparison.Pipeline/TUnit.SpeedComparison.Pipeline"
working-directory: "tools/speed-comparison/Tests.Benchmark"
9 changes: 5 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AsyncSemaphore" Version="1.2.2" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="EnumerableAsyncProcessor" Version="1.3.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
Expand All @@ -25,14 +26,14 @@
<PackageVersion Include="ModularPipelines.DotNet" Version="2.40.4" />
<PackageVersion Include="ModularPipelines.Git" Version="2.40.4" />
<PackageVersion Include="ModularPipelines.GitHub" Version="2.40.4" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.5.1" />
<PackageVersion Include="MSTest.TestFramework" Version="3.5.1" />
<PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageVersion Include="MSTest.TestFramework" Version="3.5.2" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit.Analyzers" Version="4.3.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="PolySharp" Version="1.14.1" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="TUnit" Version="0.1.476" />
<PackageVersion Include="TUnit" Version="0.1.512" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions tools/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
21 changes: 1 addition & 20 deletions tools/speed-comparison/MSTestTimer/MSTestTimer/Tests.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
using System.Diagnostics;

namespace MSTestTimer;

[TestClass]
public class Tests
{
private static readonly Stopwatch Stopwatch = new();

[ClassInitialize]
public static void Setup(TestContext _)
{
Stopwatch.Start();
}

[ClassCleanup]
public static void Cleanup()
{
Console.WriteLine(Stopwatch.Elapsed);
}

[TestMethod]
[DynamicData(nameof(Repeat), DynamicDataSourceType.Method)]
public async Task TestMethod1(int _)
Expand All @@ -28,9 +12,6 @@ public async Task TestMethod1(int _)

public static IEnumerable<object[]> Repeat()
{
foreach (var i in Enumerable.Range(0, 1001))
{
yield return [i];
}
return Enumerable.Range(0, 100).Select(i => (object[])[i]);
}
}
18 changes: 1 addition & 17 deletions tools/speed-comparison/NUnitTimer/NUnitTimer/Tests.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
using System.Diagnostics;

namespace NUnitTimer;

[Parallelizable(ParallelScope.All)]
public class Tests
{
private readonly Stopwatch _stopwatch = new();

[OneTimeSetUp]
public void Setup()
{
_stopwatch.Start();
}

[OneTimeTearDown]
public void Teardown()
{
Console.WriteLine(_stopwatch.Elapsed);
}

[Test, Repeat(1_000)]
[Test, Repeat(100)]
public async Task Test1()
{
await Task.Delay(50);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TUnit" />
Expand Down
18 changes: 1 addition & 17 deletions tools/speed-comparison/TUnitTimer/TUnitTimer/Tests.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
using System.Diagnostics;

namespace TUnitTimer;

public class Tests
{
private static readonly Stopwatch Stopwatch = new();

[Before(Class)]
public static void Setup()
{
Stopwatch.Start();
}

[After(Class)]
public static void Teardown()
{
Console.WriteLine(Stopwatch.Elapsed);
}

[Test, Repeat(1_000)]
[Test, Repeat(99)]
public async Task Test1()
{
await Task.Delay(50);
Expand Down
Loading