Skip to content

Commit 7675000

Browse files
committed
Update benchmarks
1 parent 1efa4fc commit 7675000

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,50 @@ that other libraries perform by using Oj's `StringWriter` in `rails` mode.
1414

1515
![benchmarks](docs/benchmarks.png)
1616

17+
It's really fast.
18+
19+
Using [alba benchmarks](https://github.com/thoughtbot/alba/tree/main/benchmark),
20+
`props_template` only falls slighly behind `panko` while being feature packed.
21+
The `Props::Base` [class](./lib/props_template/base.rb) that `props_template`
22+
uses is the fastest among all JSON serializers.
23+
24+
```
25+
props_base_class: 1439.9 i/s
26+
panko: 1287.6 i/s - 1.12x slower
27+
props_template: 998.8 i/s - 1.44x slower
28+
turbostreamer: 912.9 i/s - 1.58x slower
29+
alba: 871.0 i/s - 1.65x slower
30+
jserializer: 668.7 i/s - 2.15x slower
31+
alba_with_transformation: 604.2 i/s - 2.38x slower
32+
barley: 452.2 i/s - 3.18x slower
33+
barley_cache: 441.4 i/s - 3.26x slower
34+
jbuilder: 432.6 i/s - 3.33x slower
35+
fast_serializer: 390.1 i/s - 3.69x slower
36+
rails: 374.1 i/s - 3.85x slower
37+
rabl: 310.3 i/s - 4.64x slower
38+
blueprinter: 268.4 i/s - 5.36x slower
39+
representable: 187.2 i/s - 7.69x slower
40+
simple_ams: 124.5 i/s - 11.57x slower
41+
ams: 41.5 i/s - 34.67x slower
42+
alba_inline: 10.9 i/s - 131.64x slower
43+
44+
Gem versions:
45+
active_model_serializers: 0.10.16
46+
alba: 3.10.0
47+
barley: 0.9.0
48+
blueprinter: 1.2.1
49+
jbuilder: 2.14.1
50+
jserializer: 0.2.1
51+
panko_serializer: 0.8.4
52+
rabl: 0.17.0
53+
representable: 3.2.0
54+
simple_ams: 0.2.6
55+
turbostreamer: 1.11.0
56+
57+
Ruby version: 3.4.8
58+
Apple M4 Pro
59+
```
60+
1761
Caching is fast too.
1862

1963
While other libraries spend time unmarshaling,

docs/benchmarks.png

40.4 KB
Loading

0 commit comments

Comments
 (0)