forked from sebastienros/fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScribanBenchmarks.cs
38 lines (32 loc) · 1.02 KB
/
ScribanBenchmarks.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
using Scriban;
using Scriban.Runtime;
namespace Fluid.Benchmarks
{
public class ScribanBenchmarks : BaseBenchmarks
{
private Template _scribanTemplate;
public ScribanBenchmarks()
{
_scribanTemplate = Template.ParseLiquid(ProductTemplate);
}
public override object Parse()
{
return _scribanTemplate = Template.ParseLiquid(ProductTemplate);
}
public override object ParseBig()
{
return _scribanTemplate = Template.ParseLiquid(BlogPostTemplate);
}
public override string Render()
{
var scriptObject = new ScriptObject { { "products", Products } };
return _scribanTemplate.Render(scriptObject);
}
public override string ParseAndRender()
{
var template = Template.ParseLiquid(ProductTemplate);
var scriptObject = new ScriptObject { { "products", Products } };
return template.Render(scriptObject);
}
}
}