Module: ParserBenchmarkCommon

Includes:
JSON
Included in:
ParserBenchmarkExt, ParserBenchmarkPure
Defined in:
lib/crazy_ivan/vendor/json-1.1.7/benchmarks/parser_benchmark.rb

Constant Summary

Constants included from JSON

JSON::Infinity, JSON::JSON_LOADED, JSON::MAP, JSON::MinusInfinity, JSON::NaN, JSON::UnparserError, JSON::VERSION, JSON::VERSION_ARRAY, JSON::VERSION_BUILD, JSON::VERSION_MAJOR, JSON::VERSION_MINOR

Instance Method Summary collapse

Methods included from JSON

[], deep_const_get, dump, fast_generate, generate, load, parse, parse!, pretty_generate, recurse_proc, swap!, utf8_to_json

Instance Method Details

#generic_reset_methodObject



32
33
34
# File 'lib/crazy_ivan/vendor/json-1.1.7/benchmarks/parser_benchmark.rb', line 32

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

#setupObject



26
27
28
29
30
# File 'lib/crazy_ivan/vendor/json-1.1.7/benchmarks/parser_benchmark.rb', line 26

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