mirror of
https://github.com/Shopify/liquid.git
synced 2025-09-06 00:00:14 -04:00
18 lines
404 B
Ruby
18 lines
404 B
Ruby
require 'benchmark/ips'
|
|
require File.dirname(__FILE__) + '/theme_runner'
|
|
|
|
Liquid::Template.error_mode = ARGV.first.to_sym if ARGV.first
|
|
profiler = ThemeRunner.new
|
|
|
|
Benchmark.ips do |x|
|
|
x.time = 60
|
|
x.warmup = 5
|
|
|
|
puts
|
|
puts "Running benchmark for #{x.time} seconds (with #{x.warmup} seconds warmup)."
|
|
puts
|
|
|
|
x.report("parse:") { profiler.compile }
|
|
x.report("parse & run:") { profiler.run }
|
|
end
|