Sha256: 40778cbbffe51c85af7c0cb741e5da693c1fea2f7e950714b8325db19c3a7836

Contents?: true

Size: 1.38 KB

Versions: 99

Compression:

Stored size: 1.38 KB

Contents

require 'benchmark'
require 'stringio'

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

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"
  results = 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 } }
    b.report("redcarpet #{Redcarpet::VERSION}") { RUNS.times { Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(data) } }
  end

  puts
  puts "Real time of X divided by real time of kramdown"
  kd = results.shift.real
  %w[Maruku BlueFeather BlueCloth RDiscount redcarpet].each do |name|
    puts name.ljust(19) << (results.shift.real/kd).round(4).to_s
  end
end

Version data entries

99 entries across 95 versions & 21 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/benchmark/benchmark.rb