Testing And Performance Analysis - ZjzMisaka/PowerThreadPool GitHub Wiki

Unit Testing

PowerThreadPool has been meticulously tested, achieving

  • 100% test coverage
    Codecov
  • Extensive use of Assert

to ensure robustness and reliability in various scenarios.

Benchmark

Sync Report

Run 1,000 tasks, each task performs 100,000 square root calculations


BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.4061)
Unknown processor
.NET SDK 9.0.201
  [Host]     : .NET 8.0.14 (8.0.1425.11118), X64 RyuJIT AVX2
  DefaultJob : .NET 8.0.14 (8.0.1425.11118), X64 RyuJIT AVX2

Method Mean Error StdDev Gen0 Gen1 Allocated
TestDotnetThreadPool 1.375 ms 0.0269 ms 0.0251 ms 1.9531 - 31.45 KB
TestSmartThreadPool 2.830 ms 0.0036 ms 0.0032 ms 46.8750 19.5313 601.6 KB
TestPowerThreadPool 2.842 ms 0.0061 ms 0.0057 ms 39.0625 11.7188 499.08 KB

Async Report

Run 50 tasks, each task contains three await Task.Delay(10);


BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.4349)
Unknown processor
.NET SDK 9.0.201
  [Host]     : .NET 8.0.14 (8.0.1425.11118), X64 RyuJIT AVX2
  DefaultJob : .NET 8.0.14 (8.0.1425.11118), X64 RyuJIT AVX2

Method Mean Error StdDev Allocated
TestTask 46.87 ms 0.277 ms 0.259 ms 37.43 KB
TestPowerThreadPool 46.91 ms 0.181 ms 0.160 ms 277.07 KB
TestPowerThreadPoolSync 328.02 ms 1.462 ms 1.368 ms 58.77 KB