Sha256: 73d8a18756d0170b99573ae09798c7bb5f87314bd5deabdbdc9df0d0762178ab

Contents?: true

Size: 932 Bytes

Versions: 106

Compression:

Stored size: 932 Bytes

Contents

#!/usr/bin/env ruby
# encoding: iso-8859-1

#--
# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org).
# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net).
# All rights reserved.

# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
# above copyright notice is included.
#++

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

106 entries across 92 versions & 29 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/builder-3.2.3/test/performance.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/builder-3.2.3/test/performance.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/builder-3.2.3/test/performance.rb
spiral_form-0.1.1 vendor/bundle/gems/builder-3.2.3/test/performance.rb
spiral_form-0.1.0 vendor/bundle/gems/builder-3.2.3/test/performance.rb