Sha256: c4355ef4c8dbdd5c0763ba616833ecdeb56349aa5d38c5cc66d7857ddbd681ca

Contents?: true

Size: 557 Bytes

Versions: 13

Compression:

Stored size: 557 Bytes

Contents

#!/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

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
bigfleet-builder-2.2.1 test/performance.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/builder-2.1.2/test/performance.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/builder-2.1.2/test/performance.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/builder-2.1.2/test/performance.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/builder-2.1.2/test/performance.rb
middleman-0.10.17 vendor/gems/gems/builder-2.1.2/test/performance.rb
middleman-0.10.16 vendor/gems/gems/builder-2.1.2/test/performance.rb
middleman-0.10.15 vendor/gems/gems/builder-2.1.2/test/performance.rb
rackjour-0.1.8 vendor/gems/gems/builder-2.1.2/test/performance.rb
middleman-0.10.14 vendor/gems/gems/builder-2.1.2/test/performance.rb
builder-2.0.0 test/performance.rb
builder-2.1.1 test/performance.rb
builder-2.1.2 test/performance.rb