HEX
Server: Apache
System: Windows NT MAGNETO-ARM 10.0 build 22000 (Windows 10) AMD64
User: Michel (0)
PHP: 7.4.7
Disabled: NONE
Upload Files
File: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/redcarpet-3.5.1/test/benchmark.rb
# coding: UTF-8
# Thanks Kramdown for the inspiration!
require 'benchmark/ips'

require 'redcarpet'
require 'bluecloth'
require 'kramdown'

markdown = File.read(File.join(File.dirname(__FILE__), "fixtures/benchmark.md"))

# Let's bench!
Benchmark.ips do |bench|
  bench.report("Redcarpet") do
    Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(markdown)
  end

  bench.report("BlueCloth") do
    BlueCloth.new(markdown).to_html
  end

  bench.report("Kramdown") do
    Kramdown::Document.new(markdown).to_html
  end
end