Sha256: c11532c467c8eede7b00ab793fc523164642809e6b8165733ff0967133b7af91

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

require 'pathname'
require 'benchmark/ips'
require 'dry/view/renderer'
require 'action_view'

class ActionRender
  include ActionView::Helpers

  def button
    link_to('User', '/users/1')
  end
end

action_renderer = ActionRender.new
rodakase_renderer = Dry::View::Renderer.new(Pathname(__FILE__).dirname.join('templates'), engine: :erb)

template = rodakase_renderer.dir.join('button.erb')

SCOPE = {}

Benchmark.ips do |x|
  x.report('actionview') { action_renderer.button }
  x.report('rodakase') { rodakase_renderer.render(template, SCOPE) }
  x.compare!
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-view-0.1.1 benchmarks/view.rb
dry-view-0.1.0 benchmarks/view.rb