Sha256: 350be4fa38c9533f2200177b6527ba18d96a8ec25a51cfcd60f13eb0c6bce71e

Contents?: true

Size: 657 Bytes

Versions: 33

Compression:

Stored size: 657 Bytes

Contents

$: << File.join(File.dirname(__FILE__), '..', 'lib')
require 'radius'

if RUBY_PLATFORM == 'java'
  require 'java'
  require 'radius/parser/jscanner'
end

require 'benchmark'

document = <<EOF
Before it all
<r:foo>
  Middle Top
  <r:bar />
  Middle Bottom
</r:foo>
After it all
EOF

amount = 1000

Benchmark.bmbm do |bm|
  bm.report('vanilla') do
    scanner = Radius::Scanner.new(:scanner => Radius::Scanner)
    amount.times { scanner.operate('r', document) }
  end

  if RUBY_PLATFORM == 'java'
    bm.report('JavaScanner') do
      scanner = Radius::JavaScanner.new(JRuby.runtime)
      amount.times { scanner.operate('r', document) }
    end
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
depengine-0.0.31 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.21 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.20 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.19 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.18 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.17 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.16 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.15 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.14 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.13 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb
depengine-0.0.12 etc/isolate/ruby-1.8/gems/radius-0.6.1/test/benchmarks.rb