Skip to content

Commit 60ef8d3

Browse files
committed
Additional benchmark files
1 parent f547b80 commit 60ef8d3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

benchmark/encoder.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ def benchmark_encoding(name, ruby_obj)
2929

3030
benchmark_encoding "small nested array", [[1,2,3,4,5]]*10
3131
benchmark_encoding "small hash", { "username" => "jhawthorn", "id" => 123, "event" => "wrote json serializer" }
32+
benchmark_encoding "twitter.json", JSON.load_file("#{__dir__}/../test/data/twitter.json")
33+
benchmark_encoding "citm_catalog.json", JSON.load_file("#{__dir__}/../test/data/citm_catalog.json")
3234
benchmark_encoding "canada.json", JSON.load_file("#{__dir__}/../test/data/canada.json")

benchmark/parser.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ def benchmark_parsing(name, json_output)
3535
{"a":"Alpha","b":true,"c":12345,"d":[true,[false,[-123456789,null],3.9676,["Something else.",false],null]],"e":{"zero":null,"one":1,"two":2,"three":[3],"four":[0,1,2,3,4]},"f":null,"h":{"a":{"b":{"c":{"d":{"e":{"f":{"g":null}}}}}}},"i":[[[[[[[null]]]]]]]}
3636
JSON
3737

38+
benchmark_parsing "twitter.json", File.read("#{__dir__}/../test/data/twitter.json")
39+
benchmark_parsing "citm_catalog.json", File.read("#{__dir__}/../test/data/citm_catalog.json")
3840
benchmark_parsing "canada.json", File.read("#{__dir__}/../test/data/canada.json")

0 commit comments

Comments
 (0)