Sha256: de6587fe76f0ca76d03ee14cf8e0326bb7938966cea592a1aed95bab5131a42d

Contents?: true

Size: 1.11 KB

Versions: 76

Compression:

Stored size: 1.11 KB

Contents

require 'rubygems'
require 'erubis'
require 'erubis/tiny'
require 'erb'
require "benchmark"
require File.join(File.dirname(__FILE__), '..', 'lib', 'yard')

def rungen
  YARD::Registry.load_yardoc(File.join(File.dirname(__FILE__), '..', '.yardoc'))
  YARD::Registry.at("YARD::CodeObjects::Base").format(:format => :html)
end

Benchmark.bmbm do |x|
  x.report("erubis") do
    eval <<-eof
      module YARD; module Templates; module Template
        def erb_with(str, x) Erubis::Eruby.new(str) end
      end end end
    eof

    rungen
  end

  x.report("fast-erubis") do
    eval <<-eof
      module YARD; module Templates; module Template
        def erb_with(str, x) Erubis::FastEruby.new(str) end
      end end end
    eof

    rungen
  end

  x.report("tiny-erubis") do
    eval <<-eof
      module YARD; module Templates; module Template
        def erb_with(str, x) Erubis::TinyEruby.new(str) end
      end end end
    eof

    rungen
  end

  x.report("erb")  do
    eval <<-eof
       module YARD; module Templates; module Template
        def erb_with(str, x) ERB.new(str, nil) end
      end end end
    eof

    rungen
  end
end

Version data entries

76 entries across 59 versions & 8 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/yard-0.9.1/benchmarks/erb_vs_erubis.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.2/benchmarks/erb_vs_erubis.rb
yard-0.9.5 benchmarks/erb_vs_erubis.rb
yard-0.9.4 benchmarks/erb_vs_erubis.rb
yard-0.9.3 benchmarks/erb_vs_erubis.rb
yard-0.9.2 benchmarks/erb_vs_erubis.rb
yard-0.9.1 benchmarks/erb_vs_erubis.rb
yard-0.9.0 benchmarks/erb_vs_erubis.rb
yard-0.8.7.6 benchmarks/erb_vs_erubis.rb
yard-0.8.7.5 benchmarks/erb_vs_erubis.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
yard-0.8.7.4 benchmarks/erb_vs_erubis.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/benchmarks/erb_vs_erubis.rb