Add single-benchmark execute, simplify compilation

This commit is contained in:
Sam Doiron
2022-04-13 11:14:23 -03:00
parent 45ddc00710
commit f6d1b56b4e
9 changed files with 281 additions and 65 deletions
+13
View File
@@ -0,0 +1,13 @@
# frozen_string_literal: true
Benchmarks.define('simple_loop', Class.new do
TEMPLATE = "{% for i in (1..1000) %}{{ i }}{% endfor %}"
def compile
@parsed = Liquid::Template.parse(TEMPLATE)
end
def render
@parsed.render
end
end.new)