Sha256: a28e41c9bcc25c765ccdf17aee4d12ea14fb458a1108301560df4a26952c028f

Contents?: true

Size: 416 Bytes

Versions: 9

Compression:

Stored size: 416 Bytes

Contents

#!/usr/bin/env ruby

require 'bullshit'
require 'json'

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

9 entries across 9 versions & 2 rubygems

Version Path
json-1.1.0-mswin32 benchmarks/benchmark_parser.rb
json-1.0.4-mswin32 benchmarks/benchmark_parser.rb
json-1.0.3-mswin32 benchmarks/benchmark_parser.rb
json-1.1.0 benchmarks/benchmark_parser.rb
json-1.0.3 benchmarks/benchmark_parser.rb
json-1.0.4 benchmarks/benchmark_parser.rb
json_pure-1.0.3 benchmarks/benchmark_parser.rb
json_pure-1.0.4 benchmarks/benchmark_parser.rb
json_pure-1.1.0 benchmarks/benchmark_parser.rb