-
Notifications
You must be signed in to change notification settings - Fork 349
Commit f228b49
committed
name_cache implement symbolize_names support
Also micro optimize a bit further.
```
== Parsing activitypub.json (58160 bytes)
ruby 3.3.4 (2024-07-09 revision be1089c8ec) +YJIT [arm64-darwin23]
Warming up --------------------------------------
json 832.000 i/100ms
oj 799.000 i/100ms
Oj::Parser 969.000 i/100ms
rapidjson 636.000 i/100ms
Calculating -------------------------------------
json 8.020k (± 0.3%) i/s (124.70 μs/i) - 40.768k in 5.083607s
oj 7.942k (± 1.7%) i/s (125.92 μs/i) - 39.950k in 5.031909s
Oj::Parser 9.515k (± 4.4%) i/s (105.10 μs/i) - 47.481k in 5.001202s
rapidjson 6.282k (± 2.1%) i/s (159.20 μs/i) - 31.800k in 5.064719s
Comparison:
json: 8019.6 i/s
Oj::Parser: 9514.5 i/s - 1.19x faster
oj: 7941.9 i/s - same-ish: difference falls within error
rapidjson: 6281.6 i/s - 1.28x slower
== Parsing twitter.json (567916 bytes)
ruby 3.3.4 (2024-07-09 revision be1089c8ec) +YJIT [arm64-darwin23]
Warming up --------------------------------------
json 67.000 i/100ms
oj 62.000 i/100ms
Oj::Parser 79.000 i/100ms
rapidjson 55.000 i/100ms
Calculating -------------------------------------
json 670.935 (± 2.7%) i/s (1.49 ms/i) - 3.417k in 5.096850s
oj 618.937 (± 3.2%) i/s (1.62 ms/i) - 3.100k in 5.014800s
Oj::Parser 768.894 (± 1.7%) i/s (1.30 ms/i) - 3.871k in 5.036093s
rapidjson 556.882 (± 2.7%) i/s (1.80 ms/i) - 2.805k in 5.040970s
Comparison:
json: 670.9 i/s
Oj::Parser: 768.9 i/s - 1.15x faster
oj: 618.9 i/s - 1.08x slower
rapidjson: 556.9 i/s - 1.20x slower
== Parsing citm_catalog.json (1727030 bytes)
ruby 3.3.4 (2024-07-09 revision be1089c8ec) +YJIT [arm64-darwin23]
Warming up --------------------------------------
json 35.000 i/100ms
oj 32.000 i/100ms
Oj::Parser 43.000 i/100ms
rapidjson 39.000 i/100ms
Calculating -------------------------------------
json 382.262 (± 2.6%) i/s (2.62 ms/i) - 1.925k in 5.039336s
oj 348.721 (± 0.6%) i/s (2.87 ms/i) - 1.760k in 5.047265s
Oj::Parser 478.294 (± 0.6%) i/s (2.09 ms/i) - 2.408k in 5.034798s
rapidjson 398.740 (± 0.8%) i/s (2.51 ms/i) - 2.028k in 5.086365s
Comparison:
json: 382.3 i/s
Oj::Parser: 478.3 i/s - 1.25x faster
rapidjson: 398.7 i/s - 1.04x faster
oj: 348.7 i/s - 1.10x slower
```1 parent 5f1e2d1 commit f228b49Copy full SHA for f228b49
File tree
Expand file treeCollapse file tree
4 files changed
+443
-198
lines changedFilter options
- ext/json/ext/parser
Expand file treeCollapse file tree
4 files changed
+443
-198
lines changedext/json/ext/parser/name_cache.h
Copy file name to clipboardExpand all lines: ext/json/ext/parser/name_cache.h-79Lines changed: 0 additions & 79 deletions
This file was deleted.
0 commit comments