benchmark/html_escape.rb in escape_utils-0.2.1 vs benchmark/html_escape.rb in escape_utils-0.2.2
- old
+ new
@@ -20,46 +20,40 @@
url = "http://en.wikipedia.org/wiki/Line_of_succession_to_the_British_throne"
html = `curl -s #{url}`
puts "Escaping #{html.bytesize} bytes of html #{times} times, from #{url}"
Benchmark.bmbm do |x|
- x.report do
- puts "Rack::Utils.escape_html"
+ x.report "Rack::Utils.escape_html" do
times.times do
Rack::Utils.escape_html(html)
end
end
- x.report do
- puts "Haml::Helpers.html_escape"
+ x.report "Haml::Helpers.html_escape" do
times.times do
HamlBench.html_escape(html)
end
end
- x.report do
- puts "ERB::Util.html_escape"
+ x.report "ERB::Util.html_escape" do
times.times do
ERB::Util.html_escape(html)
end
end
- x.report do
- puts "CGI.escapeHTML"
+ x.report "CGI.escapeHTML" do
times.times do
CGI.escapeHTML(html)
end
end
- x.report do
- puts "fast_xs_extra#fast_xs_html"
+ x.report "fast_xs_extra#fast_xs_html" do
times.times do
html.fast_xs_html
end
end
- x.report do
- puts "EscapeUtils.escape_html"
+ x.report "EscapeUtils.escape_html" do
times.times do
EscapeUtils.escape_html(html)
end
end
end
\ No newline at end of file