forked from sebastienros/fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HandlebarsBenchmarks.cs
39 lines (33 loc) · 962 Bytes
/
HandlebarsBenchmarks.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
using HandlebarsDotNet;
using System;
namespace Fluid.Benchmarks
{
public class HandlebarsBenchmarks : BaseBenchmarks
{
private readonly HandlebarsTemplate<object, object> _handlebarsTemplate;
public HandlebarsBenchmarks()
{
_handlebarsTemplate = Handlebars.Compile(ProductTemplateMustache);
}
public override object Parse()
{
return Handlebars.Compile(ProductTemplateMustache);
}
public override object ParseBig()
{
throw new NotSupportedException();
}
public override string Render()
{
return _handlebarsTemplate(new
{
products = Products
});
}
public override string ParseAndRender()
{
var template = Handlebars.Compile(ProductTemplateMustache);
return template(new { products = Products });
}
}
}