benchmark/html_escape.rb in escape_utils-0.2.3 vs benchmark/html_escape.rb in escape_utils-0.2.4
- old
+ new
@@ -17,9 +17,10 @@
end
times = 100
url = "http://en.wikipedia.org/wiki/Line_of_succession_to_the_British_throne"
html = `curl -s #{url}`
+html = html.force_encoding('binary') if html.respond_to?(:force_encoding)
puts "Escaping #{html.bytesize} bytes of html #{times} times, from #{url}"
Benchmark.bmbm do |x|
x.report "Rack::Utils.escape_html" do
times.times do
\ No newline at end of file