Module: JSONGeneratorCommon

Includes:
Generator2BenchmarkCommon, GeneratorBenchmarkCommon
Included in:
Generator2BenchmarkExt, Generator2BenchmarkPure, GeneratorBenchmarkExt, GeneratorBenchmarkPure
Defined in:
lib/vendor/json_pure/benchmarks/generator_benchmark.rb,
lib/vendor/json_pure/benchmarks/generator2_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 Generator2BenchmarkCommon

#generic_reset_method, #setup

Methods included from JSON

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

Methods included from GeneratorBenchmarkCommon

#generic_reset_method, #setup

Instance Method Details

#benchmark_generator_asciiObject



60
61
62
# File 'lib/vendor/json_pure/benchmarks/generator_benchmark.rb', line 60

def benchmark_generator_ascii
  @result = JSON.generate(@big, :ascii_only => true)
end

#benchmark_generator_fastObject



42
43
44
# File 'lib/vendor/json_pure/benchmarks/generator_benchmark.rb', line 42

def benchmark_generator_fast
  @result = JSON.fast_generate(@big)
end

#benchmark_generator_prettyObject



54
55
56
# File 'lib/vendor/json_pure/benchmarks/generator_benchmark.rb', line 54

def benchmark_generator_pretty
  @result = JSON.pretty_generate(@big)
end

#benchmark_generator_safeObject



48
49
50
# File 'lib/vendor/json_pure/benchmarks/generator_benchmark.rb', line 48

def benchmark_generator_safe
  @result = JSON.generate(@big)
end