mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Resurrect erubi in string_template benchmark
This commit is contained in:
parent
ec1c84ac48
commit
d1f72cab2e
2 changed files with 53 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
# Original: https://github.com/amatsuda/string_template/blob/master/benchmark.rb
|
||||
require 'benchmark_driver'
|
||||
|
||||
Benchmark.driver(repeat_count: 8) do |x|
|
||||
Benchmark.driver(repeat_count: 1) do |x|
|
||||
x.prelude %{
|
||||
require 'rails'
|
||||
require 'action_view'
|
||||
|
@ -16,9 +16,11 @@ Benchmark.driver(repeat_count: 8) do |x|
|
|||
|
||||
# compile template
|
||||
hello = 'benchmark/dynamic_merger/hello'
|
||||
view.render(template: hello, handlers: 'erb')
|
||||
view.render(template: hello, handlers: 'string')
|
||||
view.render(template: hello, handlers: 'haml')
|
||||
}
|
||||
x.report 'erubi', %{ view.render(template: hello, handlers: 'erb') }
|
||||
x.report 'string', %{ view.render(template: hello, handlers: 'string') }
|
||||
x.report 'hamlit', %{ view.render(template: hello, handlers: 'haml') }
|
||||
x.loop_count 100_000
|
||||
|
|
50
benchmark/dynamic_merger/hello.erb
Normal file
50
benchmark/dynamic_merger/hello.erb
Normal file
|
@ -0,0 +1,50 @@
|
|||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
||||
hello, <%== @world %>
|
Loading…
Reference in a new issue