mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
various speedups
This commit is contained in:
@@ -4,8 +4,8 @@ require File.dirname(__FILE__) + '/theme_runner'
|
||||
|
||||
profiler = ThemeRunner.new
|
||||
|
||||
Benchmark.bmbm do |x|
|
||||
x.report("parse:") { 100.times { profiler.compile } }
|
||||
Benchmark.bm do |x|
|
||||
# x.report("parse:") { 100.times { profiler.compile } }
|
||||
x.report("parse & run:") { 100.times { profiler.run } }
|
||||
end
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ class ThemeRunner
|
||||
# Dup assigns because will make some changes to them
|
||||
|
||||
@tests.each do |liquid, layout, template_name|
|
||||
|
||||
tmpl = Liquid::Template.new
|
||||
tmpl.parse(liquid)
|
||||
tmpl = Liquid::Template.new
|
||||
@@ -54,7 +53,7 @@ class ThemeRunner
|
||||
|
||||
|
||||
def run_profile
|
||||
RubyProf.measure_mode = RubyProf::WALL_TIME
|
||||
RubyProf.measure_mode = RubyProf::PROCESS_TIME
|
||||
|
||||
# Dup assigns because will make some changes to them
|
||||
assigns = Database.tables.dup
|
||||
|
||||
Reference in New Issue
Block a user