Skip to content

Instantly share code, notes, and snippets.

@ezekg
Created April 23, 2021 21:25
Show Gist options
  • Save ezekg/f70d5035942b476b6d8fe17e95e6ec40 to your computer and use it in GitHub Desktop.
Save ezekg/f70d5035942b476b6d8fe17e95e6ec40 to your computer and use it in GitHub Desktop.
Serializer outputs ----------------------------------
alba {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
alba_inline {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
ams {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
blueprinter {"body":"post","commenter_names":["John","Jane"],"comments":[{"body":"Comment1","id":1},{"body":"Comment2","id":2}],"id":1}
jbuilder {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
jsonapi {"data":{"id":"1","type":"json_api_standard_post","attributes":{"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}}}
jsonapi_same_format {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
rails {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
representable {"id":1,"body":"post","commenter_names":["John","Jane"],"comments":[{"id":1,"body":"Comment1"},{"id":2,"body":"Comment2"}]}
Rehearsal -------------------------------------------------------
alba 0.238037 0.001980 0.240017 ( 0.240051)
alba_inline 0.516129 0.000894 0.517023 ( 0.517126)
ams 0.242860 0.001533 0.244393 ( 0.244415)
blueprinter 0.204813 0.000193 0.205006 ( 0.205025)
jbuilder 0.191874 0.000601 0.192475 ( 0.192513)
jsonapi 0.195116 0.000406 0.195522 ( 0.195539)
jsonapi_same_format 0.203020 0.001088 0.204108 ( 0.204131)
rails 0.335233 0.000347 0.335580 ( 0.335591)
representable 0.223828 0.003093 0.226921 ( 0.226925)
---------------------------------------------- total: 2.361045sec
user system total real
alba 0.185201 0.000119 0.185320 ( 0.185335)
alba_inline 0.458264 0.000657 0.458921 ( 0.458950)
ams 0.220897 0.000673 0.221570 ( 0.221625)
blueprinter 0.195143 0.002056 0.197199 ( 0.197221)
jbuilder 0.180130 0.000980 0.181110 ( 0.181207)
jsonapi 0.197847 0.001378 0.199225 ( 0.199269)
jsonapi_same_format 0.189404 0.000593 0.189997 ( 0.189995)
rails 0.337140 0.000858 0.337998 ( 0.338076)
representable 0.204318 0.000513 0.204831 ( 0.204845)
Warming up --------------------------------------
alba 502.000 i/100ms
alba_inline 201.000 i/100ms
ams 405.000 i/100ms
blueprinter 485.000 i/100ms
jbuilder 522.000 i/100ms
jsonapi 472.000 i/100ms
jsonapi_same_format 499.000 i/100ms
rails 293.000 i/100ms
representable 399.000 i/100ms
Calculating -------------------------------------
alba 5.036k (± 7.1%) i/s - 25.100k in 5.011368s
alba_inline 2.167k (± 8.7%) i/s - 10.854k in 5.049677s
ams 4.294k (± 7.7%) i/s - 21.465k in 5.029216s
blueprinter 4.911k (± 6.5%) i/s - 24.735k in 5.058563s
jbuilder 5.350k (± 6.6%) i/s - 27.144k in 5.096981s
jsonapi 4.855k (± 6.1%) i/s - 24.544k in 5.074114s
jsonapi_same_format 5.065k (± 6.0%) i/s - 25.449k in 5.043922s
rails 2.960k (± 6.0%) i/s - 14.943k in 5.068198s
representable 4.635k (± 8.9%) i/s - 23.142k in 5.038290s
Comparison:
jbuilder: 5349.7 i/s
jsonapi_same_format: 5064.6 i/s - same-ish: difference falls within error
alba: 5035.6 i/s - same-ish: difference falls within error
blueprinter: 4911.4 i/s - same-ish: difference falls within error
jsonapi: 4855.4 i/s - same-ish: difference falls within error
representable: 4634.7 i/s - same-ish: difference falls within error
ams: 4294.2 i/s - 1.25x (± 0.00) slower
rails: 2959.6 i/s - 1.81x (± 0.00) slower
alba_inline: 2167.4 i/s - 2.47x (± 0.00) slower
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment