Sha256: d4db08fd52d6cbd934aac32d485fc09a4581744373c9f4ba12f0bed0de5f785b
Contents?: true
Size: 706 Bytes
Versions: 2
Compression:
Stored size: 706 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yard-0.9.18 | benchmarks/template_erb.rb |
yard-0.9.17 | benchmarks/template_erb.rb |