Class: ParserBenchmarkYajl

Inherits:
Bullshit::RepeatCase
  • Object
show all
Defined in:
lib/vendor/json_pure/benchmarks/parser_benchmark.rb

Instance Method Summary collapse

Instance Method Details

#benchmark_parserObject



216
217
218
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 216

def benchmark_parser
  @result = Yajl::Parser.new.parse(@json)
end

#generic_reset_methodObject



220
221
222
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 220

def generic_reset_method
  @result == @big or raise "not equal"
end

#setupObject



210
211
212
213
214
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 210

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