Class: ParserBenchmarkRails

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



179
180
181
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 179

def benchmark_parser
  @result = ActiveSupport::JSON.decode(@json)
end

#generic_reset_methodObject



183
184
185
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 183

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

#setupObject



173
174
175
176
177
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 173

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