New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notes about what's going on with AMS #2169
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,56 @@ | ||
# ActiveModelSerializers | ||
# ActiveModelSerializers (Deprecated) | ||
|
||
Please use [jsonapi-rb](https://github.com/jsonapi-rb) ([docs](http://jsonapi.org)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a totally fair recommendation since not everyone wants JSON:API, and jsonapi-rb isn't the most-obvious choice for JSON:API. If we want to be fair, we should suggest ROAR, jsonapi-resources, etc. I'd be happy to add an alternatives section down where we mention dev might not be released, but generally I think this recommendation is too specific for one library. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ROAR and jsonapi-resources provide a layer on top of rails, whereas jsonapi-rb and ams are just (de)serialization |
||
|
||
Comparison of jsonapi-rb vs AMS 0.10.6 | ||
|
||
``` | ||
Calculating ------------------------------------- | ||
ams | ||
5.509 (± 1.8%) i/s - 55.000 in 10.102302s | ||
jsonapi-rb | ||
15.872 (± 0.6%) i/s - 159.000 in 10.042557s | ||
ams eager | ||
6.166 (± 1.3%) i/s - 62.000 in 10.097632s | ||
jsonapi-rb eager | ||
32.555 (± 0.8%) i/s - 327.000 in 10.079955s | ||
with 95.0% confidence | ||
|
||
Comparison: | ||
jsonapi-rb eager : 32.6 i/s | ||
jsonapi-rb : 15.9 i/s - 2.05x (± 0.02) slower | ||
ams eager : 6.2 i/s - 5.28x (± 0.08) slower | ||
ams : 5.5 i/s - 5.90x (± 0.12) slower | ||
with 95.0% confidence | ||
|
||
Calculating ------------------------------------- | ||
ams | ||
12.566M memsize ( 945.066k retained) | ||
153.201k objects ( 12.896k retained) | ||
50.000 strings ( 50.000 retained) | ||
jsonapi-rb | ||
5.670M memsize ( 0.000 retained) | ||
66.887k objects ( 0.000 retained) | ||
50.000 strings ( 0.000 retained) | ||
ams eager | ||
11.316M memsize ( 917.250k retained) | ||
136.794k objects ( 12.203k retained) | ||
50.000 strings ( 50.000 retained) | ||
jsonapi-rb eager | ||
3.564M memsize ( 0.000 retained) | ||
37.653k objects ( 0.000 retained) | ||
50.000 strings ( 0.000 retained) | ||
|
||
Comparison: | ||
jsonapi-rb eager : 3564036 allocated | ||
jsonapi-rb : 5670156 allocated - 1.59x more | ||
ams eager : 11316060 allocated - 3.18x more | ||
ams : 12565796 allocated - 3.53x more | ||
``` | ||
Every scenario builds and renders [JSONAPI.org](jsonapi.org) documents of 301 records. | ||
|
||
eager means eager loaded data (no db hits). | ||
The benchmark for this can be found [here](https://github.com/NullVoxPopuli/rails-NPlusOneTests/blob/master/serialization_benchmark.rb) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should ref a specific commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks |
||
|
||
## About | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to declare AMS dead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the description for some clarity in my intent.
like, it sucks, cause it has high visibility, but @beauby did a GREAT job with jsonapi-rb.
I just don't feel like another re-write is going to give people confidence.
migrating to jsonapi-rb is pretty straight forward, too.
tonight, I'm working on some compatibility stuff to allow smooth migration from AMS to jsonapi-rb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instructions on migration would be fantastic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also mention https://jsonapi-suite.github.io/jsonapi_suite/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's also more than serialization.
but yeah, I'll submit a separate PR for transition instructions to both AMS and jsonapi-rb when I get that stuff working. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should link down to https://github.com/rails-api/active_model_serializers#status-of-ams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated