Unify benchmark condition
This commit is contained in:
parent
0bb189b48d
commit
c737513d91
|
@ -65,7 +65,7 @@ class Bench < Thor
|
||||||
def code(file)
|
def code(file)
|
||||||
haml = File.read(file)
|
haml = File.read(file)
|
||||||
puts "#{?= * 49}\n Haml Source: #{file}\n#{?= * 49}"
|
puts "#{?= * 49}\n Haml Source: #{file}\n#{?= * 49}"
|
||||||
puts Haml::Engine.new(haml).precompiled
|
puts Haml::Engine.new(haml, escape_html: true, escape_attrs: true, ugly: true).precompiled
|
||||||
puts "\n#{?= * 49}\n Faml Source: #{file}\n#{?= * 49}"
|
puts "\n#{?= * 49}\n Faml Source: #{file}\n#{?= * 49}"
|
||||||
puts Faml::Engine.new.call(haml)
|
puts Faml::Engine.new.call(haml)
|
||||||
puts "\n#{?= * 49}\n Hamlit Source: #{file}\n#{?= * 49}"
|
puts "\n#{?= * 49}\n Hamlit Source: #{file}\n#{?= * 49}"
|
||||||
|
@ -78,7 +78,7 @@ class Bench < Thor
|
||||||
haml = File.read(file)
|
haml = File.read(file)
|
||||||
|
|
||||||
Benchmark.ips do |x|
|
Benchmark.ips do |x|
|
||||||
x.report("haml v#{Haml::VERSION}") { Haml::Engine.new(haml).precompiled }
|
x.report("haml v#{Haml::VERSION}") { Haml::Engine.new(haml, escape_html: true, escape_attrs: true, ugly: true).precompiled }
|
||||||
x.report("faml v#{Faml::VERSION}") { Faml::Engine.new.call(haml) }
|
x.report("faml v#{Faml::VERSION}") { Faml::Engine.new.call(haml) }
|
||||||
x.report("hamlit v#{Hamlit::VERSION}") { Hamlit::Engine.new.call(haml) }
|
x.report("hamlit v#{Hamlit::VERSION}") { Hamlit::Engine.new.call(haml) }
|
||||||
x.compare!
|
x.compare!
|
||||||
|
@ -93,7 +93,7 @@ class Bench < Thor
|
||||||
object.instance_eval(File.read(ruby_file))
|
object.instance_eval(File.read(ruby_file))
|
||||||
end
|
end
|
||||||
|
|
||||||
Haml::Engine.new(haml).def_method(object, :haml)
|
Haml::Engine.new(haml, escape_html: true, escape_attrs: true, ugly: true).def_method(object, :haml)
|
||||||
object.instance_eval "def faml; #{Faml::Engine.new.call(haml)}; end"
|
object.instance_eval "def faml; #{Faml::Engine.new.call(haml)}; end"
|
||||||
object.instance_eval "def hamlit; #{Hamlit::Engine.new.call(haml)}; end"
|
object.instance_eval "def hamlit; #{Hamlit::Engine.new.call(haml)}; end"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue