Sha256: 7a195f4c0bc86b1ecff2a66611148488d1bed05c51fd5df9d0bd42c40fc408aa

Contents?: true

Size: 683 Bytes

Versions: 32

Compression:

Stored size: 683 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))
          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

32 entries across 32 versions & 4 rubygems

Version Path
kinetic_sdk-5.0.25 gems/yard-0.9.25/benchmarks/template_erb.rb
kinetic_sdk-5.0.24 gems/yard-0.9.25/benchmarks/template_erb.rb
kinetic_sdk-5.0.23 gems/yard-0.9.25/benchmarks/template_erb.rb
kinetic_sdk-5.0.22 gems/yard-0.9.25/benchmarks/template_erb.rb
kinetic_sdk-5.0.21 gems/yard-0.9.25/benchmarks/template_erb.rb
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/yard-0.9.28/benchmarks/template_erb.rb
kinetic_sdk-5.0.20 gems/yard-0.9.25/benchmarks/template_erb.rb
yard-0.9.28 benchmarks/template_erb.rb
yard-0.9.27 benchmarks/template_erb.rb
yard-0.9.26 benchmarks/template_erb.rb
qiita_org-0.1.35 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.34 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.33 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.32 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.31 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.30 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.29 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.28 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.27 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb
qiita_org-0.1.26 gems/ruby/2.7.0/gems/yard-0.9.25/benchmarks/template_erb.rb