Sha256: 2c2724980b128e2cb78f4a0ad0624156d140866f14ccdd0a2098a11acb36bba5

Contents?: true

Size: 477 Bytes

Versions: 98

Compression:

Stored size: 477 Bytes

Contents

#!/usr/bin/env ruby

require 'bullshit'
if ARGV.shift == 'pure'
  require 'json/pure'
else
  require 'json/ext'
end

class BC_Parser < Bullshit::TimeCase
  include JSON

  warmup    true
  duration  10

  def setup
    a = [ nil, false, true, "fÖß\nÄr", [ "n€st€d", true ], { "fooß" => "bär", "qu\r\nux" => true } ]
    @big = a * 100
    @json = JSON.generate(@big)
  end

  def benchmark_parser
    a = JSON.parse(@json)
    a == @big or raise "not equal"
  end
end

Version data entries

98 entries across 92 versions & 14 rubygems

Version Path
poolparty-1.6.5 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.6.4 vendor/gems/json/benchmarks/benchmark_parser.rb
merb-core-1.1.0.rc1 spec10/public/core_ext/fixtures/gems/gems/json_pure-1.1.3/benchmarks/benchmark_parser.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/json_pure-1.1.3/benchmarks/benchmark_parser.rb
poolparty-1.6.3 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.6.2 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.6.1 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.6.0 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.5.0 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.8 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.7 vendor/gems/json/benchmarks/benchmark_parser.rb
factorylabs-castronaut-0.7.5 vendor/json/benchmarks/benchmark_parser.rb
poolparty-1.4.6 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.5 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.4 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.3 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.2 vendor/gems/json/benchmarks/benchmark_parser.rb
poolparty-1.4.1 vendor/gems/json/benchmarks/benchmark_parser.rb
merb-core-1.1.0.pre spec10/public/core_ext/fixtures/gems/gems/json_pure-1.1.3/benchmarks/benchmark_parser.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/json_pure-1.1.3/benchmarks/benchmark_parser.rb