Sha256: 9b2ea38bb1afc182131da7aaee5ef703a7ebc8d5fed470efd4c0a38db2457519

Contents?: true

Size: 1019 Bytes

Versions: 2

Compression:

Stored size: 1019 Bytes

Contents

require 'benchmark'
require 'stringio'

require 'kramdown'
require 'bluecloth'
require 'maruku'
require 'maruku/version'
require 'rdiscount'
require 'bluefeather'

module MaRuKu::Errors
  def tell_user(s)
  end
end


RUNS=20

FILES=['mdsyntax.text', 'mdbasics.text']

puts "Running tests on #{Time.now.strftime("%Y-%M-%d")} under #{RUBY_DESCRIPTION}"

FILES.each do |file|
  data = File.read(File.join(File.dirname(__FILE__), file))
  puts
  puts "Test using file #{file} and #{RUNS} runs"
  Benchmark.bmbm do |b|
    b.report("kramdown #{Kramdown::VERSION}") { RUNS.times { Kramdown::Document.new(data).to_html } }
    b.report("Maruku #{MaRuKu::Version}") { RUNS.times { Maruku.new(data, :on_error => :ignore).to_html } }
    b.report("BlueFeather #{BlueFeather::VERSION}") { RUNS.times { BlueFeather.parse(data) } }
    b.report("BlueCloth #{BlueCloth::VERSION}") { RUNS.times { BlueCloth.new(data).to_html } }
    b.report("RDiscount #{RDiscount::VERSION}") { RUNS.times { RDiscount.new(data).to_html } }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kramdown-0.4.0 benchmark/benchmark.rb
kramdown-0.3.0 benchmark/benchmark.rb