Sha256: 528c8e51c73986f1496d7a1d73875a471d547790a297760286864c0a9a3b5404

Contents?: true

Size: 951 Bytes

Versions: 31

Compression:

Stored size: 951 Bytes

Contents

# Original: https://github.com/amatsuda/string_template/blob/master/benchmark.rb
require 'benchmark_driver'

Benchmark.driver(repeat_count: 8) do |x|
  x.prelude %{
    require 'rails'
    require 'action_view'
    require 'string_template'
    StringTemplate::Railtie.run_initializers
    require 'hamlit'
    Hamlit::Railtie.run_initializers
    Hamlit::RailsTemplate.set_options(escape_html: false, generator: Temple::Generators::ArrayBuffer)
    require 'action_view/base'

    (view = Class.new(ActionView::Base).new(ActionView::LookupContext.new(''))).instance_variable_set(:@world, 'world!')

    # compile template
    hello = 'benchmark/dynamic_merger/hello'
    view.render(template: hello, handlers: 'string')
    view.render(template: hello, handlers: 'haml')
  }
  x.report 'string', %{ view.render(template: hello, handlers: 'string') }
  x.report 'hamlit', %{ view.render(template: hello, handlers: 'haml') }
  x.loop_count 100_000
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hamlit-2.15.0-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.15.0 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.6 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.6-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.5-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.5 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.4 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.4-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.3-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.3 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.2-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.2 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.0 benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.0-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.1-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.14.1 benchmark/dynamic_merger/benchmark.rb
hamlit-2.13.2-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.13.2 benchmark/dynamic_merger/benchmark.rb
hamlit-2.13.1-java benchmark/dynamic_merger/benchmark.rb
hamlit-2.13.1 benchmark/dynamic_merger/benchmark.rb