From 91f55cdb38d982e12ab34acd66fc5afcb350f168 Mon Sep 17 00:00:00 2001 From: Fryderyk Huang Date: Sun, 21 Jan 2024 02:54:01 +0800 Subject: [PATCH] fix benchmark --- scripts/GenBenchmarkPage.ps1 | 1 - src/BenchmarkResultPageGenerator/Program.cs | 10 ++++------ src/NullGC.DragRace/BenchmarkBase.cs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/GenBenchmarkPage.ps1 b/scripts/GenBenchmarkPage.ps1 index 3dfdc73..baed9b9 100644 --- a/scripts/GenBenchmarkPage.ps1 +++ b/scripts/GenBenchmarkPage.ps1 @@ -1,7 +1,6 @@ . $PSScriptRoot\Variables.ps1 Push-Location $SolutionDir Copy-Item $BenchmarkArtifactsDir\results\*.html $BenchmarkResultPageDir -Get-ChildItem -Recurse -Force ..\artifacts dotnet run --project .\BenchmarkResultPageGenerator\BenchmarkResultPageGenerator.csproj (Join-Path $BenchmarkArtifactsDir results) (Join-Path $BenchmarkResultPageDir index.html) if (!$?) { throw } Pop-Location diff --git a/src/BenchmarkResultPageGenerator/Program.cs b/src/BenchmarkResultPageGenerator/Program.cs index e526fd5..ebdd2a8 100644 --- a/src/BenchmarkResultPageGenerator/Program.cs +++ b/src/BenchmarkResultPageGenerator/Program.cs @@ -6,9 +6,10 @@ namespace BenchmarkResultPageGenerator; -internal partial class Program +internal class Program { - private static readonly Regex FileNamePattern = MyRegex(); + private static readonly Regex FileNamePattern = new(@"^(\w+\.)+Benchmarks\.(?\w+)\-report", + RegexOptions.Compiled | RegexOptions.CultureInvariant); private static async Task Main(string[] args) { @@ -34,10 +35,7 @@ private static async Task Main(string[] args) await File.WriteAllTextAsync(output, await (await new RazorEngine().CompileAsync(await sr.ReadToEndAsync())) .RunAsync(new { - Files = lst.OrderBy(x=>x.Title) + Files = lst.OrderBy(x => x.Title) })); } - - [GeneratedRegex(@"^(\w+\.)+Benchmarks\.(?\w+)\-report", RegexOptions.Compiled | RegexOptions.CultureInvariant)] - private static partial Regex MyRegex(); } \ No newline at end of file diff --git a/src/NullGC.DragRace/BenchmarkBase.cs b/src/NullGC.DragRace/BenchmarkBase.cs index d052b6c..6ffd106 100644 --- a/src/NullGC.DragRace/BenchmarkBase.cs +++ b/src/NullGC.DragRace/BenchmarkBase.cs @@ -8,7 +8,7 @@ public abstract class BenchmarkBase : IDisposable { protected BenchmarkBase() { - AllocatorContext.SetImplementation(new DefaultAllocatorContextImpl().ConfigureDefault()); + AllocatorContext.SetImplementation(new DefaultAllocatorContextImpl()); } // [GlobalSetup]