Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
fryderykhuang committed Jan 20, 2024
1 parent 637fa1c commit 91f55cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion scripts/GenBenchmarkPage.ps1
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions src/BenchmarkResultPageGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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\.(?<class>\w+)\-report",
RegexOptions.Compiled | RegexOptions.CultureInvariant);

private static async Task Main(string[] args)
{
Expand All @@ -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\.(?<class>\w+)\-report", RegexOptions.Compiled | RegexOptions.CultureInvariant)]
private static partial Regex MyRegex();
}
2 changes: 1 addition & 1 deletion src/NullGC.DragRace/BenchmarkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public abstract class BenchmarkBase : IDisposable
{
protected BenchmarkBase()
{
AllocatorContext.SetImplementation(new DefaultAllocatorContextImpl().ConfigureDefault());
AllocatorContext.SetImplementation(new DefaultAllocatorContextImpl());
}

// [GlobalSetup]
Expand Down

0 comments on commit 91f55cd

Please sign in to comment.