Sha256: 6b285b0af51b58ac18c0a805d6823157ac1cbc54413390d083f4d60da4741c3a

Contents?: true

Size: 688 Bytes

Versions: 11

Compression:

Stored size: 688 Bytes

Contents

# frozen_string_literal: true
require "benchmark"
require File.join(File.dirname(__FILE__), '..', 'lib', 'yard')

YARD::Registry.load_yardoc(File.join(File.dirname(__FILE__), '..', '.yardoc'))
obj = YARD::Registry.at("YARD::CodeObjects::Base")

TIMES = 3
Benchmark.bm do |x|
  x.report("trim-line") { TIMES.times { obj.format(:format => :html) } }
  module YARD
    module Templates
      module Template
        def erb(section, &block)
          erb = ERB.new(cache(section), nil)
          erb.filename = cache_filename(section).to_s
          erb.result(binding, &block)
        end
      end
    end
  end
  x.report("no-trim  ") { TIMES.times { obj.format(:format => :html) } }
end

Version data entries

11 entries across 10 versions & 4 rubygems

Version Path
yard-0.9.12 benchmarks/template_erb.rb
yard-0.9.11 benchmarks/template_erb.rb
yard-0.9.10 benchmarks/template_erb.rb
yard-0.9.9 benchmarks/template_erb.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/benchmarks/template_erb.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/benchmarks/template_erb.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/benchmarks/template_erb.rb
yard-0.9.8 benchmarks/template_erb.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/benchmarks/template_erb.rb
yard-0.9.7 benchmarks/template_erb.rb
yard-0.9.6 benchmarks/template_erb.rb