From 6197b91a7cfce43f34dcfc8f28f9d75b9337ea98 Mon Sep 17 00:00:00 2001 From: Preston Sego Date: Tue, 1 Aug 2017 13:54:56 -0400 Subject: [PATCH 1/4] add note about not using AMS --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ad3398a61..5582d92f2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,56 @@ -# ActiveModelSerializers +# ActiveModelSerializers (Deprecated) + +Please use [jsonapi-rb](https://github.com/jsonapi-rb) ([docs](http://jsonapi.org)) + +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) ## About From 137edd1677f1ffbc108574fef994d5ec57f99ebe Mon Sep 17 00:00:00 2001 From: Preston Sego Date: Tue, 1 Aug 2017 14:24:11 -0400 Subject: [PATCH 2/4] update benchmark url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5582d92f2..d6bbb307a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ 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) +The benchmark for this can be found [here](https://github.com/NullVoxPopuli/rails-NPlusOneTests/blob/2a5ebfec262e53d8bcb7f3308388fc5ba64f599d/serialization_benchmark.rb) ## About From 14cbe713a43d1f3330c52336ae5b5912c305d2fd Mon Sep 17 00:00:00 2001 From: Preston Sego Date: Wed, 2 Aug 2017 18:15:02 -0400 Subject: [PATCH 3/4] update readme --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d6bbb307a..65dae1204 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,16 @@ -# ActiveModelSerializers (Deprecated) +# ActiveModelSerializers -Please use [jsonapi-rb](https://github.com/jsonapi-rb) ([docs](http://jsonapi.org)) +## Status of AMS +AMS has had quite the rocky history. 3 rewrites, and possibly a 4th. Currently AMS is open to Proof of Concept Design PRs. + +### Motivation for yet another re-write + - The maintainers of AMS have cycled in and out a few times, and the code base has become unwieldy + - 0.10.x's architecture could not handle all the feature requests in an elegant way. + - performance of AMS is bad/slow. + +##### Performance Comparison (jsonapi-rb vs AMS 0.10.6). -Comparison of jsonapi-rb vs AMS 0.10.6 +AMS is about 6 times slower than [jsonapi-rb](http://jsonapi-rb.org) ``` Calculating ------------------------------------- @@ -52,6 +60,9 @@ Every scenario builds and renders [JSONAPI.org](jsonapi.org) documents of 301 re eager means eager loaded data (no db hits). The benchmark for this can be found [here](https://github.com/NullVoxPopuli/rails-NPlusOneTests/blob/2a5ebfec262e53d8bcb7f3308388fc5ba64f599d/serialization_benchmark.rb) + + + ## About ## Installation From f7408a8d00d52be9f1bdd5b6724b400a2a0a8716 Mon Sep 17 00:00:00 2001 From: Preston Sego Date: Thu, 3 Aug 2017 08:41:05 -0400 Subject: [PATCH 4/4] update benchmark ref to ams branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65dae1204..b9a0fbb57 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ 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/2a5ebfec262e53d8bcb7f3308388fc5ba64f599d/serialization_benchmark.rb) +The benchmark for this can be found [here](https://github.com/rails-api/active_model_serializers/blob/43c1518cfff680781b943075ceeb6ca61a3536dd/benchmarks/serialization_libraries/benchmark.rb)