mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
Add single-benchmark execute, simplify compilation
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Benchmarks.define('fizzbuzz_10000', Class.new do
|
||||
TEMPLATE = <<~LIQUID
|
||||
{% for i in (1..10000) %}{{ i }}
|
||||
{% endfor %}
|
||||
LIQUID
|
||||
Benchmarks.define('simple_loop', Class.new do
|
||||
TEMPLATE = "{% for i in (1..1000) %}{{ i }}{% endfor %}"
|
||||
|
||||
def compile
|
||||
@parsed = Liquid::Template.parse(TEMPLATE)
|
||||
|
||||
@@ -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)
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
require_relative '../theme_runner'
|
||||
|
||||
Benchmarks.define('theme_runner', ThemeRunner.new)
|
||||
#Benchmarks.define('theme_runner', ThemeRunner.new)
|
||||
Reference in New Issue
Block a user