deserialization_benchmark.rb
Each of these scenarios just changes the payload to be parsed, and does not change any deserialization options.
Calculating -------------------------------------
ams 13.415k (± 0.8%) i/s - 135.160k in 10.095866s
jsonapi-rb 18.495k (± 1.7%) i/s - 182.413k in 10.100698s
custom 221.752k (± 1.3%) i/s - 2.175M in 9.981512s
with 95.0% confidence
Comparison:
custom : 221752.5 i/s
jsonapi-rb: 18494.6 i/s - 11.99x (± 0.27) slower
ams : 13415.1 i/s - 16.53x (± 0.26) slower
with 95.0% confidence
Calculating -------------------------------------
ams 10.296k memsize ( 0.000 retained)
74.000 objects ( 0.000 retained)
4.000 strings ( 0.000 retained)
jsonapi-rb 10.744k memsize ( 0.000 retained)
91.000 objects ( 0.000 retained)
31.000 strings ( 0.000 retained)
custom 640.000 memsize ( 0.000 retained)
5.000 objects ( 0.000 retained)
3.000 strings ( 0.000 retained)
Comparison:
custom : 640 allocated
ams : 10296 allocated - 16.09x more
jsonapi-rb: 10744 allocated - 16.79x more
Calculating -------------------------------------
ams 7.702k (± 0.8%) i/s - 77.147k in 10.045611s
jsonapi-rb 9.791k (± 1.2%) i/s - 97.350k in 10.069045s
custom 147.919k (± 1.6%) i/s - 1.461M in 10.042105s
with 95.0% confidence
Comparison:
custom : 147918.8 i/s
jsonapi-rb: 9791.5 i/s - 15.11x (± 0.31) slower
ams : 7701.6 i/s - 19.21x (± 0.35) slower
with 95.0% confidence
Calculating -------------------------------------
ams 11.968k memsize ( 40.000 retained)
93.000 objects ( 1.000 retained)
6.000 strings ( 1.000 retained)
jsonapi-rb 12.822k memsize ( 80.000 retained)
122.000 objects ( 2.000 retained)
39.000 strings ( 2.000 retained)
custom 840.000 memsize ( 0.000 retained)
10.000 objects ( 0.000 retained)
7.000 strings ( 0.000 retained)
Comparison:
custom : 840 allocated
ams : 11968 allocated - 14.25x more
jsonapi-rb: 12822 allocated - 15.26x more
Calculating -------------------------------------
ams 5.675k (± 0.7%) i/s - 56.784k in 10.029038s
jsonapi-rb 6.814k (± 0.9%) i/s - 68.234k in 10.079003s
custom 111.095k (± 1.5%) i/s - 1.101M in 10.019325s
with 95.0% confidence
Comparison:
custom : 111095.3 i/s
jsonapi-rb: 6813.6 i/s - 16.30x (± 0.30) slower
ams : 5674.9 i/s - 19.58x (± 0.33) slower
with 95.0% confidence
Calculating -------------------------------------
ams 13.520k memsize ( 40.000 retained)
109.000 objects ( 1.000 retained)
8.000 strings ( 1.000 retained)
jsonapi-rb 14.776k memsize ( 120.000 retained)
150.000 objects ( 3.000 retained)
43.000 strings ( 3.000 retained)
custom 1.040k memsize ( 0.000 retained)
15.000 objects ( 0.000 retained)
9.000 strings ( 0.000 retained)
Comparison:
custom : 1040 allocated
ams : 13520 allocated - 13.00x more
jsonapi-rb: 14776 allocated - 14.21x more
I don't think AMS deserializes has_many relationships (at least by default)
Calculating -------------------------------------
ams 6.618k (± 0.6%) i/s - 66.465k in 10.052403s
jsonapi-rb 4.591k (± 1.2%) i/s - 45.430k in 10.083374s
custom 4.726k (± 0.9%) i/s - 47.066k in 10.015956s
with 95.0% confidence
Comparison:
ams : 6617.9 i/s
custom : 4726.5 i/s - 1.40x (± 0.02) slower
jsonapi-rb: 4590.8 i/s - 1.44x (± 0.02) slower
with 95.0% confidence
Calculating -------------------------------------
ams 13.256k memsize ( 40.000 retained)
104.000 objects ( 1.000 retained)
7.000 strings ( 1.000 retained)
jsonapi-rb 15.106k memsize ( 80.000 retained)
149.000 objects ( 2.000 retained)
39.000 strings ( 2.000 retained)
custom 3.936k memsize ( 0.000 retained)
40.000 objects ( 0.000 retained)
9.000 strings ( 0.000 retained)
Comparison:
custom : 3936 allocated
ams : 13256 allocated - 3.37x more
jsonapi-rb: 15106 allocated - 3.84x more
Any updates on this after the release of https://github.com/Netflix/fast_jsonapi ?