Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple JSON.dump and JSON.load benchmark #580

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

eregon
Copy link
Member

@eregon eregon commented Apr 15, 2024

  • Restoring benchmarks/ohai.json from dad9fbf.

The commit intended to fix #117, that's still fixed as these new files are not included in the gem s.files =.

eregon added a commit to eregon/json that referenced this pull request Apr 15, 2024
* Using the benchmark from ruby#580
$ ruby benchmarks/bench.rb dump pure
JSON::Pure::Generator
truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]
Warming up --------------------------------------
      JSON.dump(obj)   116.000 i/100ms
      JSON.dump(obj)   235.000 i/100ms
      JSON.dump(obj)   317.000 i/100ms
      JSON.dump(obj)   372.000 i/100ms
      JSON.dump(obj)   374.000 i/100ms
Calculating -------------------------------------
      JSON.dump(obj)      3.735k (± 0.9%) i/s  (267.76 μs/i) -     18.700k in   5.007526s
      JSON.dump(obj)      3.738k (± 0.7%) i/s  (267.49 μs/i) -     18.700k in   5.002252s
      JSON.dump(obj)      3.743k (± 0.7%) i/s  (267.18 μs/i) -     19.074k in   5.096375s
      JSON.dump(obj)      3.747k (± 0.5%) i/s  (266.87 μs/i) -     19.074k in   5.090463s
      JSON.dump(obj)      3.746k (± 0.5%) i/s  (266.96 μs/i) -     19.074k in   5.092069s
$ ruby benchmarks/bench.rb dump ext
JSON::Ext::Generator
truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]
Warming up --------------------------------------
      JSON.dump(obj)    19.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    21.000 i/100ms
Calculating -------------------------------------
      JSON.dump(obj)    221.260 (±10.8%) i/s    (4.52 ms/i) -      1.092k in   5.004381s
      JSON.dump(obj)    221.983 (± 8.1%) i/s    (4.50 ms/i) -      1.113k in   5.055574s
      JSON.dump(obj)    221.446 (± 8.6%) i/s    (4.52 ms/i) -      1.113k in   5.073167s
      JSON.dump(obj)    226.452 (± 7.9%) i/s    (4.42 ms/i) -      1.134k in   5.048568s
      JSON.dump(obj)    227.795 (± 8.3%) i/s    (4.39 ms/i) -      1.134k in   5.025187s
eregon added a commit to eregon/json that referenced this pull request Apr 16, 2024
* Using the benchmark from ruby#580
$ ruby benchmarks/bench.rb dump pure
JSON::Pure::Generator
truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]
Warming up --------------------------------------
      JSON.dump(obj)   116.000 i/100ms
      JSON.dump(obj)   235.000 i/100ms
      JSON.dump(obj)   317.000 i/100ms
      JSON.dump(obj)   372.000 i/100ms
      JSON.dump(obj)   374.000 i/100ms
Calculating -------------------------------------
      JSON.dump(obj)      3.735k (± 0.9%) i/s  (267.76 μs/i) -     18.700k in   5.007526s
      JSON.dump(obj)      3.738k (± 0.7%) i/s  (267.49 μs/i) -     18.700k in   5.002252s
      JSON.dump(obj)      3.743k (± 0.7%) i/s  (267.18 μs/i) -     19.074k in   5.096375s
      JSON.dump(obj)      3.747k (± 0.5%) i/s  (266.87 μs/i) -     19.074k in   5.090463s
      JSON.dump(obj)      3.746k (± 0.5%) i/s  (266.96 μs/i) -     19.074k in   5.092069s
$ ruby benchmarks/bench.rb dump ext
JSON::Ext::Generator
truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]
Warming up --------------------------------------
      JSON.dump(obj)    19.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    21.000 i/100ms
Calculating -------------------------------------
      JSON.dump(obj)    221.260 (±10.8%) i/s    (4.52 ms/i) -      1.092k in   5.004381s
      JSON.dump(obj)    221.983 (± 8.1%) i/s    (4.50 ms/i) -      1.113k in   5.055574s
      JSON.dump(obj)    221.446 (± 8.6%) i/s    (4.52 ms/i) -      1.113k in   5.073167s
      JSON.dump(obj)    226.452 (± 7.9%) i/s    (4.42 ms/i) -      1.134k in   5.048568s
      JSON.dump(obj)    227.795 (± 8.3%) i/s    (4.39 ms/i) -      1.134k in   5.025187s
@eregon
Copy link
Member Author

eregon commented Apr 16, 2024

@hsbt Could you review this too? (if not, who should I ask?)

* Restoring benchmarks/ohai.json from dad9fbf.
@hsbt
Copy link
Member

hsbt commented Jun 3, 2024

👍

@hsbt hsbt merged commit 80b5865 into ruby:master Jun 3, 2024
75 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Jun 4, 2024
… faster

* Using the benchmark from ruby/json#580
$ ruby benchmarks/bench.rb dump pure
JSON::Pure::Generator
truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]
Warming up --------------------------------------
      JSON.dump(obj)   116.000 i/100ms
      JSON.dump(obj)   235.000 i/100ms
      JSON.dump(obj)   317.000 i/100ms
      JSON.dump(obj)   372.000 i/100ms
      JSON.dump(obj)   374.000 i/100ms
Calculating -------------------------------------
      JSON.dump(obj)      3.735k (± 0.9%) i/s  (267.76 μs/i) -     18.700k in   5.007526s
      JSON.dump(obj)      3.738k (± 0.7%) i/s  (267.49 μs/i) -     18.700k in   5.002252s
      JSON.dump(obj)      3.743k (± 0.7%) i/s  (267.18 μs/i) -     19.074k in   5.096375s
      JSON.dump(obj)      3.747k (± 0.5%) i/s  (266.87 μs/i) -     19.074k in   5.090463s
      JSON.dump(obj)      3.746k (± 0.5%) i/s  (266.96 μs/i) -     19.074k in   5.092069s
$ ruby benchmarks/bench.rb dump ext
JSON::Ext::Generator
truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux]
Warming up --------------------------------------
      JSON.dump(obj)    19.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    18.000 i/100ms
      JSON.dump(obj)    21.000 i/100ms
Calculating -------------------------------------
      JSON.dump(obj)    221.260 (±10.8%) i/s    (4.52 ms/i) -      1.092k in   5.004381s
      JSON.dump(obj)    221.983 (± 8.1%) i/s    (4.50 ms/i) -      1.113k in   5.055574s
      JSON.dump(obj)    221.446 (± 8.6%) i/s    (4.52 ms/i) -      1.113k in   5.073167s
      JSON.dump(obj)    226.452 (± 7.9%) i/s    (4.42 ms/i) -      1.134k in   5.048568s
      JSON.dump(obj)    227.795 (± 8.3%) i/s    (4.39 ms/i) -      1.134k in   5.025187s

ruby/json@8256455cdc
@eregon eregon mentioned this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't include benchmark results in gem
2 participants