mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
* Speed up lexing * Bump msrv to 3.0 (from 2.7) * Normalize test for ruby-head compat * Fix bug when parsing negative numbers
22 lines
511 B
Ruby
22 lines
511 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'benchmark/ips'
|
|
require_relative 'theme_runner'
|
|
|
|
RubyVM::YJIT.enable if defined?(RubyVM::YJIT)
|
|
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
|