Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 61c236d9aa
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (26 sloc) 0.557 kB
#!/usr/bin/env ruby
require 'builder/xmlmarkup'
require 'benchmark'
text = "This is a test of the new xml markup. Iñtërnâtiônàlizætiøn\n" * 10000
include Benchmark # we need the CAPTION and FMTSTR constants
include Builder
n = 50
Benchmark.benchmark do |bm|
tf = bm.report("base") {
n.times do
x = XmlMarkup.new
x.text(text)
x.target!
end
}
def XmlMarkup._escape(text)
text.to_xs
end
tf = bm.report("to_xs") {
n.times do
x = XmlMarkup.new
x.text(text)
x.target!
end
}
end
Jump to Line
Something went wrong with that request. Please try again.