mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
19 lines
432 B
Ruby
19 lines
432 B
Ruby
require 'benchmark/ips'
|
|
require_relative 'theme_runner'
|
|
|
|
Liquid::Template.error_mode = ARGV.first.to_sym if ARGV.first
|
|
profiler = ThemeRunner.new
|
|
|
|
Benchmark.ips do |x|
|
|
x.time = 10
|
|
x.warmup = 5
|
|
|
|
puts
|
|
puts "Running benchmark for #{x.time} seconds (with #{x.warmup} seconds warmup)."
|
|
puts
|
|
|
|
x.report("parse:") { profiler.compile }
|
|
x.report("render:") { profiler.render }
|
|
x.report("parse & render:") { profiler.run }
|
|
end
|