From b771f2dc6430bb7a7e4bb58198ea7c4c20e55da4 Mon Sep 17 00:00:00 2001 From: Florian Frank Date: Fri, 20 Nov 2009 08:25:55 +0100 Subject: use smaller iteration valus --- benchmarks/generator2_benchmark.rb | 14 ++++++++++---- benchmarks/generator_benchmark.rb | 14 ++++++++++---- benchmarks/parser2_benchmark.rb | 10 +++++----- benchmarks/parser_benchmark.rb | 10 +++++----- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/benchmarks/generator2_benchmark.rb b/benchmarks/generator2_benchmark.rb index 7b9fa74..56f173c 100755 --- a/benchmarks/generator2_benchmark.rb +++ b/benchmarks/generator2_benchmark.rb @@ -14,6 +14,7 @@ when 'rails' require 'active_support' when 'yajl' require 'yajl' + require 'yajl/json_gem' require 'stringio' end @@ -65,7 +66,7 @@ class Generator2BenchmarkExt < Bullshit::RepeatCase include JSONGeneratorCommon warmup yes - iterations 8000 + iterations 500 truncate_data do enabled false @@ -91,7 +92,7 @@ class Generator2BenchmarkPure < Bullshit::RepeatCase include JSONGeneratorCommon warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -116,7 +117,7 @@ class Generator2BenchmarkRails < Bullshit::RepeatCase include Generator2BenchmarkCommon warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -147,7 +148,7 @@ class Generator2BenchmarkYajl < Bullshit::RepeatCase include Generator2BenchmarkCommon warmup yes - iterations 8000 + iterations 500 truncate_data do enabled false @@ -173,6 +174,10 @@ class Generator2BenchmarkYajl < Bullshit::RepeatCase @result = output.string end + def benchmark_generator_gem_api + @result = @big.to_json + end + def reset_benchmark_generator generic_reset_method end @@ -210,6 +215,7 @@ if $0 == __FILE__ benchmark Generator2BenchmarkPure, :generator_ascii, :load => yes benchmark Generator2BenchmarkRails, :generator, :load => yes benchmark Generator2BenchmarkYajl, :generator, :load => yes + benchmark Generator2BenchmarkYajl, :generator_gem_api, :load => yes end end end diff --git a/benchmarks/generator_benchmark.rb b/benchmarks/generator_benchmark.rb index 9d6aec3..272fc1d 100755 --- a/benchmarks/generator_benchmark.rb +++ b/benchmarks/generator_benchmark.rb @@ -14,6 +14,7 @@ when 'rails' require 'active_support' when 'yajl' require 'yajl' + require 'yajl/json_gem' require 'stringio' end @@ -67,7 +68,7 @@ class GeneratorBenchmarkExt < Bullshit::RepeatCase include JSONGeneratorCommon warmup yes - iterations 8000 + iterations 500 truncate_data do enabled false @@ -93,7 +94,7 @@ class GeneratorBenchmarkPure < Bullshit::RepeatCase include JSONGeneratorCommon warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -118,7 +119,7 @@ class GeneratorBenchmarkRails < Bullshit::RepeatCase include GeneratorBenchmarkCommon warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -149,7 +150,7 @@ class GeneratorBenchmarkYajl < Bullshit::RepeatCase include GeneratorBenchmarkCommon warmup yes - iterations 8000 + iterations 500 truncate_data do enabled false @@ -175,6 +176,10 @@ class GeneratorBenchmarkYajl < Bullshit::RepeatCase @result = output.string end + def benchmark_generator_gem_api + @result = @big.to_json + end + def reset_benchmark_generator generic_reset_method end @@ -212,6 +217,7 @@ if $0 == __FILE__ benchmark GeneratorBenchmarkPure, :generator_ascii, :load => yes benchmark GeneratorBenchmarkRails, :generator, :load => yes benchmark GeneratorBenchmarkYajl, :generator, :load => yes + benchmark GeneratorBenchmarkYajl, :generator_gem_api, :load => yes end end end diff --git a/benchmarks/parser2_benchmark.rb b/benchmarks/parser2_benchmark.rb index bc80772..e24ee21 100755 --- a/benchmarks/parser2_benchmark.rb +++ b/benchmarks/parser2_benchmark.rb @@ -39,7 +39,7 @@ class Parser2BenchmarkExt < Bullshit::RepeatCase include Parser2BenchmarkCommon warmup yes - iterations 4000 + iterations 500 truncate_data do enabled false @@ -70,7 +70,7 @@ class Parser2BenchmarkPure < Bullshit::RepeatCase include Parser2BenchmarkCommon warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -99,7 +99,7 @@ end class Parser2BenchmarkYAML < Bullshit::RepeatCase warmup yes - iterations 1000 + iterations 100 truncate_data do enabled false @@ -134,7 +134,7 @@ end class Parser2BenchmarkRails < Bullshit::RepeatCase warmup yes - iterations 500 + iterations 100 truncate_data do alpha_level 0.05 @@ -170,7 +170,7 @@ end class Parser2BenchmarkYajl < Bullshit::RepeatCase warmup yes - iterations 4000 + iterations 500 truncate_data do alpha_level 0.05 diff --git a/benchmarks/parser_benchmark.rb b/benchmarks/parser_benchmark.rb index acb8ea4..9ca88d7 100755 --- a/benchmarks/parser_benchmark.rb +++ b/benchmarks/parser_benchmark.rb @@ -41,7 +41,7 @@ class ParserBenchmarkExt < Bullshit::RepeatCase include ParserBenchmarkCommon warmup yes - iterations 8000 + iterations 500 truncate_data do enabled false @@ -72,7 +72,7 @@ class ParserBenchmarkPure < Bullshit::RepeatCase include ParserBenchmarkCommon warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -101,7 +101,7 @@ end class ParserBenchmarkYAML < Bullshit::RepeatCase warmup yes - iterations 1000 + iterations 100 truncate_data do enabled false @@ -138,7 +138,7 @@ end class ParserBenchmarkRails < Bullshit::RepeatCase warmup yes - iterations 500 + iterations 100 truncate_data do enabled false @@ -175,7 +175,7 @@ end class ParserBenchmarkYajl < Bullshit::RepeatCase warmup yes - iterations 8000 + iterations 500 truncate_data do enabled false -- cgit v1.2.1