benchmark/README.md in alba-3.4.0 vs benchmark/README.md in alba-3.5.0
- old
+ new
@@ -1,9 +1,27 @@
## Benchmark for json serializers
-This directory contains a few different benchmark scripts. They all use inline Bundler definitions so you can run them by `ruby benchmark/collection.rb` for instance.
+This directory contains a few different benchmark scripts.
+## How to run
+
+```
+bundle install
+
+# with `Oj.optimize_rails`
+bundle exec ruby collection.rb
+
+# without `Oj.optimize_rails`
+NO_OJ_OPTIMIZE_RAILS=1 bundle exec ruby collection.rb
+
+# with `Oj.optimize_rails` and YJIT
+YJIT=1 bundle exec ruby collection.rb
+
+# with YJIT and without `Oj.optimize_rails`
+YJIT=1 NO_OJ_OPTIMIZE_RAILS=1 bundle exec ruby collection.rb
+```
+
## Result
As a reference, here's the benchmark result run in my (@okuramasafumi) machine.
Machine spec:
@@ -63,11 +81,11 @@
representable: 43.4 i/s - 10.55x slower
simple_ams: 34.7 i/s - 13.20x slower
ams: 14.2 i/s - 32.28x slower
```
-`benchmark-ips` with `Oj.optimize_rail` and YJIT:
+`benchmark-ips` with `Oj.optimize_rails` and YJIT:
```
Comparison:
panko: 676.6 i/s
jserializer: 285.3 i/s - 2.37x slower
@@ -80,10 +98,10 @@
representable: 73.5 i/s - 9.21x slower
simple_ams: 62.8 i/s - 10.77x slower
ams: 20.4 i/s - 33.10x slower
```
-`benchmark-ips` with YJIT and without `Oj.optimize_rail`:
+`benchmark-ips` with YJIT and without `Oj.optimize_rails`:
```
Comparison:
panko: 701.9 i/s
alba: 311.1 i/s - 2.26x slower