forked from sebastienros/fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComparisonBenchmarks.cs
99 lines (84 loc) · 2.86 KB
/
ComparisonBenchmarks.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
namespace Fluid.Benchmarks
{
[MemoryDiagnoser, GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
public class ComparisonBenchmarks
{
private FluidBenchmarks _fluidBenchmarks = new FluidBenchmarks();
private HandlebarsBenchmarks _handlebarsBenchmarks = new HandlebarsBenchmarks();
private DotLiquidBenchmarks _dotLiquidBenchmarks = new DotLiquidBenchmarks();
private LiquidNetBenchmarks _liquidNetBenchmarks = new LiquidNetBenchmarks();
private ScribanBenchmarks _scribanBenchmarks = new ScribanBenchmarks();
[Benchmark(Baseline = true), BenchmarkCategory("Parse")]
public object Fluid_Parse()
{
return _fluidBenchmarks.Parse();
}
[Benchmark(Baseline = true), BenchmarkCategory("ParseBig")]
public object Fluid_ParseBig()
{
return _fluidBenchmarks.ParseBig();
}
[Benchmark(Baseline = true), BenchmarkCategory("Render")]
public string Fluid_Render()
{
return _fluidBenchmarks.Render();
}
[Benchmark, BenchmarkCategory("Parse")]
public object Scriban_Parse()
{
return _scribanBenchmarks.Parse();
}
[Benchmark, BenchmarkCategory("ParseBig")]
public object Scriban_ParseBig()
{
return _scribanBenchmarks.ParseBig();
}
[Benchmark, BenchmarkCategory("Render")]
public string Scriban_Render()
{
return _scribanBenchmarks.Render();
}
[Benchmark, BenchmarkCategory("Parse")]
public object DotLiquid_Parse()
{
return _dotLiquidBenchmarks.Parse();
}
[Benchmark, BenchmarkCategory("ParseBig")]
public object DotLiquid_ParseBig()
{
return _dotLiquidBenchmarks.ParseBig();
}
[Benchmark, BenchmarkCategory("Render")]
public string DotLiquid_Render()
{
return _dotLiquidBenchmarks.Render();
}
[Benchmark, BenchmarkCategory("Parse")]
public object LiquidNet_Parse()
{
return _liquidNetBenchmarks.Parse();
}
[Benchmark, BenchmarkCategory("ParseBig")]
public object LiquidNet_ParseBig()
{
return _liquidNetBenchmarks.ParseBig();
}
[Benchmark, BenchmarkCategory("Render")]
public string LiquidNet_Render()
{
return _liquidNetBenchmarks.Render();
}
[Benchmark, BenchmarkCategory("Parse")]
public object Handlebars_Parse()
{
return _handlebarsBenchmarks.Parse();
}
[Benchmark, BenchmarkCategory("Render")]
public string Handlebars_Render()
{
return _handlebarsBenchmarks.Render();
}
}
}