-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (41 loc) · 1.81 KB
/
Copy pathProgram.cs
File metadata and controls
44 lines (41 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Threading.Tasks;
using BenchmarkDotNet.Running;
using Heddle.Performance.Runners;
namespace Heddle.Performance
{
public class Program
{
public static void Main(string[] args) {
// Fast, host-free D1 parity harness: `dotnet run -c Release -- parity`. Confirms every
// competitor twin renders output identical to Heddle after the documented normalization
// without spinning up the full BenchmarkDotNet run (which the render GlobalSetup also asserts).
if (args != null && args.Length > 0 && string.Equals(args[0], "parity", StringComparison.OrdinalIgnoreCase))
{
var (homeMatch, homeText) = ParityCheck.Report();
Console.Write(homeText);
var (subMatch, subText) = ParityCheck.ReportSubstitution();
Console.Write(subText);
var (loopMatch, loopText) = ParityCheck.ReportLoop();
Console.Write(loopText);
Environment.Exit(homeMatch && subMatch && loopMatch ? 0 : 1);
return;
}
// Switcher so either suite runs, e.g. `dotnet run -c Release -- --filter *TemplateParseBenchmarks*`.
// With no args it prompts; the render head-to-head stays the default when a single type is selected.
if (args != null && args.Length > 0)
{
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
return;
}
BenchmarkRunner.Run<TextRenderBenchmarks>();
// var runner = new TextRenderBenchmarks();
// await runner.Setup();
// while (true) {
// await runner.RenderHeddle();
// }
//
// await runner.Teardown();
}
}
}