summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2009-12-03 01:34:53 +0100
committerFlorian Frank <flori@ping.de>2009-12-03 01:34:53 +0100
commit14d97def3f9a3fed4d0b5721144bb60fe481896b (patch)
tree7dcf6acfc61bb19f0c43e683300f553c1c24e393
parent5f420debe6291197e97965b859c4a51f587c0144 (diff)
downloadjson-14d97def3f9a3fed4d0b5721144bb60fe481896b.tar.gz
benchmark symbolized names
-rwxr-xr-xbenchmarks/parser_benchmark.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmarks/parser_benchmark.rb b/benchmarks/parser_benchmark.rb
index 38af54d..1626327 100755
--- a/benchmarks/parser_benchmark.rb
+++ b/benchmarks/parser_benchmark.rb
@@ -62,6 +62,12 @@ class ParserBenchmarkExt < Bullshit::RepeatCase
end
alias reset_parser generic_reset_method
+
+ def benchmark_parser_symbolic
+ @result = JSON.parse(@json, :symbolize_names => true)
+ end
+
+ alias reset_parser_symbolc generic_reset_method
end
class ParserBenchmarkPure < Bullshit::RepeatCase
@@ -92,6 +98,12 @@ class ParserBenchmarkPure < Bullshit::RepeatCase
end
alias reset_parser generic_reset_method
+
+ def benchmark_parser_symbolic
+ @result = JSON.parse(@json, :symbolize_names => true)
+ end
+
+ alias reset_parser_symbolc generic_reset_method
end
class ParserBenchmarkYAML < Bullshit::RepeatCase
@@ -189,7 +201,9 @@ if $0 == __FILE__
output_filename File.join(File.dirname(__FILE__), 'data', 'ParserBenchmarkComparison.log')
benchmark ParserBenchmarkExt, :parser, :load => yes
+ benchmark ParserBenchmarkExt, :parser_symbolic, :load => yes
benchmark ParserBenchmarkPure, :parser, :load => yes
+ benchmark ParserBenchmarkPure, :parser_symbolic, :load => yes
benchmark ParserBenchmarkYAML, :parser, :load => yes
benchmark ParserBenchmarkRails, :parser, :load => yes
end