Skip to content

Commit

Permalink
✅ Add prepareVariables benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Apr 27, 2024
1 parent caf968e commit eaf9c82
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions benchmark/05-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,35 @@ suite('Renderer()', function() {
hawkejs.createRenderer();
});

bench('#renderHTML()', function() {
bench('renderHTML()', function() {
renderer = hawkejs.createRenderer();
return renderer.renderHTML('nested_test');
});

bench('#toDry()', function() {
bench('toDry()', function() {
renderer = hawkejs.createRenderer();
variables = main.createTestVariables();
renderer.variables = variables;
__Protoblast.Bound.JSON.toDryObject(renderer)
});

bench('prepareVariables()', () => {

let raw_variables = {
a_number : 14,
b_string : 'A string',
c_boolean : true,
d_array : [1, 2, 3],
e_object : {
a: 1,
b: 2,
c: 3,
rx: /regex/,
map: new Map([['a', 1], ['b', 2]]),
}
};

let prepared = renderer.prepareVariables(raw_variables);
});
});

0 comments on commit eaf9c82

Please sign in to comment.