From 36fad3997fa73f1a6add47caf804d9d708610abc Mon Sep 17 00:00:00 2001
From: Alex Kessinger This repository maintains a set of benchmarks for python serialization frameworks. Currently the following projects are benchmarked. This repository maintains a set of benchmarks for python serialization frameworks. You can find the latest benchmarks on this page. Currently the following projects are benchmarked. Each framework is asked to serialize a list of 2 objcts a 1000 times, and then 1 object a 1000 times.
Python Serialization Benchmark
+
+Library One Object Many Objects
+--------------------- ------------ --------------
+Strainer 0.0334759 0.00678802
+serpy 0.0388439 0.0073688
+Colander 0.145118 0.028892
+Marshmallow 0.607224 0.118006
+Django REST Framework 1.30471 0.185136
+
\ No newline at end of file
From 8957503198f8e264a41bef156132037d6117c617 Mon Sep 17 00:00:00 2001
From: Travis CI Python Serialization Benchmark
Python Serialization Benchmark
Library One Object Many Objects
--------------------- ------------ --------------
-Strainer 0.0334759 0.00678802
-serpy 0.0388439 0.0073688
-Colander 0.145118 0.028892
-Marshmallow 0.607224 0.118006
-Django REST Framework 1.30471 0.185136
+Strainer 0.0336289 0.006814
+serpy 0.0392451 0.00742602
+Colander 0.145964 0.029237
+Marshmallow 0.605923 0.117652
+Django REST Framework 1.32028 0.187281
\ No newline at end of file
From ec26ce20a821335ca5f0d675f356dfbbbd0ba16a Mon Sep 17 00:00:00 2001
From: Travis CI Python Serialization Benchmark
-Library One Object Many Objects
---------------------- ------------ --------------
-Strainer 0.0336289 0.006814
-serpy 0.0392451 0.00742602
-Colander 0.145964 0.029237
-Marshmallow 0.605923 0.117652
-Django REST Framework 1.32028 0.187281
-
\ No newline at end of file
+Library Many Objects One Object
Strainer 0.0689921 0.0345008 +serpy 0.0743518 0.03845 +Colander 0.311117 0.145795 +Marshmallow 1.15847 0.59406 +Django REST Framework 1.86901 1.27994 +
\ No newline at end of file From 9fcae9dc111675158a5d562943bf34106ed1e465 Mon Sep 17 00:00:00 2001 From: Travis CIEach framework is asked to serialize a list of 2 objcts a 1000 times, and then 1 object a 1000 times. +
Each framework is asked to serialize a list of 2 objcts a 1000 times, and then 1 object a 1000 times.
-Library Many Objects One Object -\ No newline at end of file +Library Many Objects One Object +--------------------- -------------- ------------ +Strainer 0.0657301 0.0327411 +serpy 0.102354 0.0389669 +Colander 0.291603 0.145159 +Marshmallow 1.25196 0.598393 +Django REST Framework 1.86221 1.30072 + \ No newline at end of file From e0a093a252c0129b0722c27745a4aa0f3202481d Mon Sep 17 00:00:00 2001 From: Travis CI
-Strainer 0.0689921 0.0345008 -serpy 0.0743518 0.03845 -Colander 0.311117 0.145795 -Marshmallow 1.15847 0.59406 -Django REST Framework 1.86901 1.27994 -
Along with a baseline of a custom function that doesn't use a framework.
Each framework is asked to serialize a list of 2 objcts a 1000 times, and then 1 object a 1000 times.
Library Many Objects One Object --------------------- -------------- ------------ -Strainer 0.0657301 0.0327411 -serpy 0.102354 0.0389669 -Colander 0.291603 0.145159 -Marshmallow 1.25196 0.598393 -Django REST Framework 1.86221 1.30072 +Custom 0.013675 0.00681901 +Strainer 0.068732 0.034344 +serpy 0.0736301 0.039283 +Colander 0.32582 0.153205 +Marshmallow 1.29869 0.658006 +Django REST Framework 1.97302 1.3905\ No newline at end of file From c95e0a5a7e49cdbdc013c59c59ef85a91cc7e0ba Mon Sep 17 00:00:00 2001 From: Travis CI
Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.013675 0.00681901 -Strainer 0.068732 0.034344 -serpy 0.0736301 0.039283 -Colander 0.32582 0.153205 -Marshmallow 1.29869 0.658006 -Django REST Framework 1.97302 1.3905 +Custom 0.0138059 0.00694203 +Strainer 0.0658381 0.0329778 +serpy 0.072367 0.0382979 +Colander 0.28919 0.14445 +subjects.loli 0.639348 0.311311 +Marshmallow 1.17502 0.602514 +Django REST Framework 1.86723 1.29026\ No newline at end of file From b6210eef7424d4e3f3a98a18b8053eb1a26c7455 Mon Sep 17 00:00:00 2001 From: Travis CI
Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.0138059 0.00694203 -Strainer 0.0658381 0.0329778 -serpy 0.072367 0.0382979 -Colander 0.28919 0.14445 -subjects.loli 0.639348 0.311311 -Marshmallow 1.17502 0.602514 -Django REST Framework 1.86723 1.29026 +Custom 0.0171781 0.00692487 +Strainer 0.0833452 0.0340791 +serpy 0.089483 0.038825 +subjects.loli 0.73178 0.328769 +Marshmallow 1.23391 0.610214 +Django REST Framework 1.96648 1.40255\ No newline at end of file From 51dc178bd8244a8e79a9a999ada6e39273c335be Mon Sep 17 00:00:00 2001 From: Travis CI
Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.0171781 0.00692487 -Strainer 0.0833452 0.0340791 -serpy 0.089483 0.038825 -subjects.loli 0.73178 0.328769 -Marshmallow 1.23391 0.610214 -Django REST Framework 1.96648 1.40255 +Custom 0.0139711 0.00697112 +Strainer 0.069011 0.0333052 +serpy 0.0743809 0.040561 +Lollipop 0.651375 0.336125 +Marshmallow 1.23853 0.625176 +Django REST Framework 1.9754 1.32321\ No newline at end of file From 3615fd8390a37fb064bee79ffb12826e41c1f49e Mon Sep 17 00:00:00 2001 From: Travis CI
You can find the latest benchmarks on this page.
Currently the following projects are benchmarked.
Along with a baseline of a custom function that doesn't use a framework.
Each framework is asked to serialize a list of 2 objcts a 1000 times, and then 1 object a 1000 times.
Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.0139711 0.00697112 -Strainer 0.069011 0.0333052 -serpy 0.0743809 0.040561 -Lollipop 0.651375 0.336125 -Marshmallow 1.23853 0.625176 -Django REST Framework 1.9754 1.32321 +Custom 0.013634 0.00682497 +Strainer 0.0675151 0.0337131 +serpy 0.0722299 0.0381689 +Lollipop 0.658723 0.324521 +Marshmallow 1.2704 0.624744 +Django REST Framework 2.07065 1.33223\ No newline at end of file From 306d29fade430bb189089839347e21ec8e5e0347 Mon Sep 17 00:00:00 2001 From: Travis CI
Along with a baseline of a custom function that doesn't use a framework.
-Each framework is asked to serialize a list of 2 objcts a 1000 times, and then 1 object a 1000 times.
+Each framework is asked to serialize a list of 2 objects a 1000 times, and then 1 object a 1000 times.
Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.013634 0.00682497 -Strainer 0.0675151 0.0337131 -serpy 0.0722299 0.0381689 -Lollipop 0.658723 0.324521 -Marshmallow 1.2704 0.624744 -Django REST Framework 2.07065 1.33223 +Custom 0.013813 0.00686789 +Strainer 0.069042 0.034332 +serpy 0.0770888 0.0383739 +Lollipop 0.648447 0.315976 +Marshmallow 1.17259 0.597804 +Django REST Framework 1.88957 1.32931\ No newline at end of file From 4c551c22ebd129d2d2809fec0bb432522bd1c855 Mon Sep 17 00:00:00 2001 From: Travis CI
Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.013813 0.00686789 -Strainer 0.069042 0.034332 -serpy 0.0770888 0.0383739 -Lollipop 0.648447 0.315976 -Marshmallow 1.17259 0.597804 -Django REST Framework 1.88957 1.32931 +Custom 0.01373 0.00689316 +Strainer 0.0705271 0.0354161 +serpy 0.0734689 0.038516 +Lollipop 0.659461 0.321331 +Marshmallow 1.26974 0.601069 +Django REST Framework 1.9317 1.32093\ No newline at end of file From 924ffed3a59b5dca3a59c1fb8c74f835bd1631cc Mon Sep 17 00:00:00 2001 From: Travis CI
This repository maintains a set of benchmarks for python serialization frameworks.
You can find the latest benchmarks on this page.
Currently the following projects are benchmarked.
-Along with a baseline of a custom function that doesn't use a framework.
-Each framework is asked to serialize a list of 2 objects a 1000 times, and then 1 object a 1000 times.
--Library Many Objects One Object ++ +Along with a baseline custom function that doesn't use a framework.
+\ No newline at end of file +Custom 0.0139651 0.00691795 +Strainer 0.068619 0.0343139 +serpy 0.073632 0.038933 +Lollipop 0.662228 0.322233 +Marshmallow 1.1968 0.612923 +Django REST Framework 1.87166 1.30884 +Library Many Objects One Object --------------------- -------------- ------------ -Custom 0.01373 0.00689316 -Strainer 0.0705271 0.0354161 -serpy 0.0734689 0.038516 -Lollipop 0.659461 0.321331 -Marshmallow 1.26974 0.601069 -Django REST Framework 1.9317 1.32093 -
Each framework is asked to serialize a list of 2 objects a 1000 times, and then 1 object a 1000 times.
+This is the current object that is being serialized.
+class ChildTestObject(object):
+ def __init__(self, multiplier=None):
+ self.w = 1000 * multiplier if multiplier else 100
+ self.x = 20 * multiplier if multiplier else 20
+ self.y = 'hello' * multiplier if multiplier else 'hello'
+ self.z = 10 * multiplier if multiplier else 10
+
+
+class ParentTestObject(object):
+ def __init__(self):
+ self.foo = 'bar'
+ self.sub = ChildTestObject()
+ self.subs = [ChildTestObject(i) for i in xrange(10)]
+
+ def bar(self):
+ return 5
+
+benchmark_object = ParentTestObject()
+
+
+Serialization from python objects to JSON, XML, or other transmission formats is a common task for many web related projects. In order to fill that need a number of frameworks have arised. While their aims are similar, they don't all share the same attributes. Here are how some of the features comapre.
+| Project | +Serialization | +Encoding | +Deserialization | +Validation | +
| Django REST Framework | +Yes | +Yes | +Yes | +Yes | +
| serpy | +Yes | +No | +No | +No | +
| marshmallow | +Yes | +Yes | +Yes | +Yes | +
| Lollipop | +Yes | +No | +Yes | +Yes | +
| strainer | +Yes | +Yes | +Yes | +Yes | +
Along with a baseline custom function that doesn't use a framework.
Library Many Objects One Object
--------------------- -------------- ------------
-Custom 0.0139651 0.00691795
-Strainer 0.068619 0.0343139
-serpy 0.073632 0.038933
-Lollipop 0.662228 0.322233
-Marshmallow 1.1968 0.612923
-Django REST Framework 1.87166 1.30884
+Custom 0.0137529 0.00688696
+Strainer 0.0598509 0.0299289
+serpy 0.072109 0.0382042
+Lollipop 0.642238 0.31396
+Marshmallow 1.15195 0.622856
+Django REST Framework 1.92448 1.29381
Along with a baseline custom function that doesn't use a framework.
Library Many Objects One Object
--------------------- -------------- ------------
-Custom 0.0137529 0.00688696
-Strainer 0.0598509 0.0299289
-serpy 0.072109 0.0382042
-Lollipop 0.642238 0.31396
-Marshmallow 1.15195 0.622856
-Django REST Framework 1.92448 1.29381
+Custom 0.0139072 0.00688696
+Strainer 0.099998 0.0301809
+serpy 0.092308 0.0561631
+Lollipop 0.639235 0.352615
+Marshmallow 1.1639 0.699365
+Django REST Framework 2.0504 1.5498
Along with a baseline custom function that doesn't use a framework.
Library Many Objects One Object
--------------------- -------------- ------------
-Custom 0.0139072 0.00688696
-Strainer 0.099998 0.0301809
-serpy 0.092308 0.0561631
-Lollipop 0.639235 0.352615
-Marshmallow 1.1639 0.699365
-Django REST Framework 2.0504 1.5498
+Custom 0.013824 0.00690889
+Strainer 0.0605829 0.0303049
+serpy 0.0726092 0.0383818
+Lollipop 0.655558 0.319407
+Marshmallow 1.14359 0.555189
+Django REST Framework 1.88762 1.30062
Along with a baseline custom function that doesn't use a framework.
Library Many Objects One Object
--------------------- -------------- ------------
-Custom 0.013824 0.00690889
-Strainer 0.0605829 0.0303049
-serpy 0.0726092 0.0383818
-Lollipop 0.655558 0.319407
-Marshmallow 1.14359 0.555189
-Django REST Framework 1.88762 1.30062
+Custom 0.0137758 0.00682688
+Strainer 0.0596168 0.030277
+serpy 0.07267 0.0382729
+Lollipop 0.473351 0.228435
+Marshmallow 1.10127 0.556963
+Django REST Framework 1.87502 1.31233
+kim 2.29187 1.15728
Along with a baseline custom function that doesn't use a framework.
Library Many Objects One Object
--------------------- -------------- ------------
-Custom 0.0137758 0.00682688
-Strainer 0.0596168 0.030277
-serpy 0.07267 0.0382729
-Lollipop 0.473351 0.228435
-Marshmallow 1.10127 0.556963
-Django REST Framework 1.87502 1.31233
-kim 2.29187 1.15728
+Custom 0.0138531 0.00697112
+Strainer 0.0602059 0.0299511
+serpy 0.072561 0.0382328
+Lollipop 0.477565 0.229895
+Marshmallow 1.18749 0.567287
+Django REST Framework 1.90874 1.31186
+kim 2.27016 1.13375
Along with a baseline custom function that doesn't use a framework.
Library Many Objects One Object
--------------------- -------------- ------------
-Custom 0.0138531 0.00697112
-Strainer 0.0602059 0.0299511
-serpy 0.072561 0.0382328
-Lollipop 0.477565 0.229895
-Marshmallow 1.18749 0.567287
-Django REST Framework 1.90874 1.31186
-kim 2.27016 1.13375
+Custom 0.0187769 0.00682402
+Strainer 0.0603201 0.0337129
+serpy 0.073787 0.038656
+Lollipop 0.47821 0.231566
+Marshmallow 1.14844 0.598486
+Django REST Framework 1.94096 1.3277
+kim 2.28477 1.15237
Along with a baseline custom function that doesn't use a framework.
-Library Many Objects One Object
---------------------- -------------- ------------
-Custom 0.0187769 0.00682402
-Strainer 0.0603201 0.0337129
-serpy 0.073787 0.038656
-Lollipop 0.47821 0.231566
-Marshmallow 1.14844 0.598486
-Django REST Framework 1.94096 1.3277
-kim 2.28477 1.15237
+Library Many Objects (seconds) One Object (seconds)
+--------------------- ------------------------ ----------------------
+Custom 0.0147464 0.00725865
+lima 0.0186098 0.00937057
+serpy 0.0557761 0.029979
+Strainer 0.0647128 0.0323169
+Lollipop 0.569409 0.273222
+Marshmallow 1.11986 0.468423
+Django REST Framework 1.2735 0.877778
+kim 2.73208 1.33061
The Benchmark
From 60e781d8c747cfc184f842bde7adc908350875cf Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Mon, 24 Apr 2017 14:06:14 +0000
Subject: [PATCH 21/32] Deploy to GitHub Pages:
5e3c164fa06e93e02af6b522dccfb200585a3764
---
index.html | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/index.html b/index.html
index 398343e..d9392b4 100644
--- a/index.html
+++ b/index.html
@@ -17,16 +17,29 @@ Python Serialization Benchmark
kim
Along with a baseline custom function that doesn't use a framework.
-Library Many Objects (seconds) One Object (seconds)
---------------------- ------------------------ ----------------------
-Custom 0.0147464 0.00725865
-lima 0.0186098 0.00937057
-serpy 0.0557761 0.029979
-Strainer 0.0647128 0.0323169
-Lollipop 0.569409 0.273222
-Marshmallow 1.11986 0.468423
-Django REST Framework 1.2735 0.877778
-kim 2.73208 1.33061
+Running the test suite
+A Docker container is bundled with the repository which you can use to run the benchmarks. Firstly make sure you have Docker installed.
+
+-
+
Install Docker
+
+-
+
Build the container $ docker-compose build
+
+-
+
Run the tests. $ docker-compose run --rm tests
+
+
+Library Many Objects (seconds) One Object (seconds) Relative
+--------------------- ------------------------ ---------------------- ----------
+Custom 0.015099 0.00744438 1
+lima 0.0184031 0.00941515 1.23398
+serpy 0.0564134 0.0302956 3.84631
+Strainer 0.0645332 0.0326135 4.30932
+Lollipop 0.572213 0.275513 37.6042
+Marshmallow 0.955579 0.494589 64.3277
+kim 1.10544 0.548943 73.3867
+Django REST Framework 1.38124 0.979011 104.698
The Benchmark
From 7ab74b1a79f2d5bdbd73e9c393e291d7ff317473 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Sun, 27 Aug 2017 04:56:59 +0000
Subject: [PATCH 22/32] Deploy to GitHub Pages:
c77971dc02b5bce9fd5feb0ddac672dabcace661
---
index.html | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/index.html b/index.html
index d9392b4..eb40ca3 100644
--- a/index.html
+++ b/index.html
@@ -15,6 +15,7 @@ Python Serialization Benchmark
Strainer
Lollipop
kim
+toasted-marshmallow
Along with a baseline custom function that doesn't use a framework.
Running the test suite
@@ -32,14 +33,15 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.015099 0.00744438 1
-lima 0.0184031 0.00941515 1.23398
-serpy 0.0564134 0.0302956 3.84631
-Strainer 0.0645332 0.0326135 4.30932
-Lollipop 0.572213 0.275513 37.6042
-Marshmallow 0.955579 0.494589 64.3277
-kim 1.10544 0.548943 73.3867
-Django REST Framework 1.38124 0.979011 104.698
+Custom 0.0256822 0.013052 1
+lima 0.0383852 0.0197146 1.49996
+serpy 0.104605 0.0706699 4.52507
+Strainer 0.114318 0.0885544 5.23755
+Toasted Marshmallow 0.292227 0.135766 11.0495
+Lollipop 1.23894 0.419955 42.8277
+Marshmallow 2.13818 0.749287 74.5457
+kim 2.46978 1.32616 97.9997
+Django REST Framework 2.53841 1.75292 110.789
The Benchmark
From 2230bf173295a1691da25f900c4188b3a0842f15 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Mon, 2 Jul 2018 22:22:03 +0000
Subject: [PATCH 23/32] Deploy to GitHub Pages:
f16cf9f940f7c92530acb01598c46559799f5bf5
---
index.html | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/index.html b/index.html
index eb40ca3..ea04a92 100644
--- a/index.html
+++ b/index.html
@@ -16,6 +16,7 @@ Python Serialization Benchmark
Lollipop
kim
toasted-marshmallow
+Colander
Along with a baseline custom function that doesn't use a framework.
Running the test suite
@@ -33,15 +34,16 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0256822 0.013052 1
-lima 0.0383852 0.0197146 1.49996
-serpy 0.104605 0.0706699 4.52507
-Strainer 0.114318 0.0885544 5.23755
-Toasted Marshmallow 0.292227 0.135766 11.0495
-Lollipop 1.23894 0.419955 42.8277
-Marshmallow 2.13818 0.749287 74.5457
-kim 2.46978 1.32616 97.9997
-Django REST Framework 2.53841 1.75292 110.789
+Custom 0.0329726 0.0159111 1
+lima 0.0401821 0.0206914 1.24527
+serpy 0.142545 0.0760007 4.47073
+Strainer 0.197942 0.0984321 6.06284
+Toasted Marshmallow 0.296397 0.153362 9.2006
+Lollipop 0.7695 0.325401 22.3981
+Colander 0.942478 0.459746 28.6849
+kim 1.30952 0.785586 42.859
+Marshmallow 2.15868 1.0906 66.4696
+Django REST Framework 2.6968 1.89875 94.0099
The Benchmark
From 901da2d61850648931912ff8e4a733468ac2f73b Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Mon, 2 Jul 2018 22:26:49 +0000
Subject: [PATCH 24/32] Deploy to GitHub Pages:
f16cf9f940f7c92530acb01598c46559799f5bf5
---
index.html | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/index.html b/index.html
index ea04a92..d404678 100644
--- a/index.html
+++ b/index.html
@@ -34,16 +34,16 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0329726 0.0159111 1
-lima 0.0401821 0.0206914 1.24527
-serpy 0.142545 0.0760007 4.47073
-Strainer 0.197942 0.0984321 6.06284
-Toasted Marshmallow 0.296397 0.153362 9.2006
-Lollipop 0.7695 0.325401 22.3981
-Colander 0.942478 0.459746 28.6849
-kim 1.30952 0.785586 42.859
-Marshmallow 2.15868 1.0906 66.4696
-Django REST Framework 2.6968 1.89875 94.0099
+Custom 0.0229433 0.0117581 1
+lima 0.0243461 0.0123394 1.05718
+serpy 0.0917017 0.0510154 4.11273
+Strainer 0.161441 0.0835772 7.06076
+Toasted Marshmallow 0.169405 0.0808725 7.21234
+Colander 0.626526 0.296166 26.5895
+Lollipop 0.887586 0.476963 39.3226
+Marshmallow 1.40761 0.743763 61.9967
+kim 1.59593 0.73712 67.2323
+Django REST Framework 1.98968 1.41337 98.0668
The Benchmark
From 8ea7667f246097328e3112df28ce7da954739b36 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Mon, 2 Jul 2018 22:29:07 +0000
Subject: [PATCH 25/32] Deploy to GitHub Pages:
22024be5ebad07b6d1e0d8f013cdfa497687e414
---
index.html | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/index.html b/index.html
index d404678..4a6c608 100644
--- a/index.html
+++ b/index.html
@@ -34,16 +34,16 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0229433 0.0117581 1
-lima 0.0243461 0.0123394 1.05718
-serpy 0.0917017 0.0510154 4.11273
-Strainer 0.161441 0.0835772 7.06076
-Toasted Marshmallow 0.169405 0.0808725 7.21234
-Colander 0.626526 0.296166 26.5895
-Lollipop 0.887586 0.476963 39.3226
-Marshmallow 1.40761 0.743763 61.9967
-kim 1.59593 0.73712 67.2323
-Django REST Framework 1.98968 1.41337 98.0668
+Custom 0.0185211 0.00847864 1
+lima 0.0323029 0.0103629 1.58023
+serpy 0.0767255 0.0402741 4.33337
+Strainer 0.111886 0.0480838 5.92485
+Toasted Marshmallow 0.147332 0.0805259 8.43926
+Colander 0.460081 0.237314 25.8297
+Lollipop 0.744028 0.349707 40.5091
+kim 1.4407 0.691975 78.9887
+Marshmallow 1.7112 0.871818 95.6683
+Django REST Framework 1.62452 1.11424 101.437
The Benchmark
From c7b267e802d5648cd06d4c80e4e07130360a904a Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Sun, 7 Jul 2019 17:07:41 +0000
Subject: [PATCH 26/32] Deploy to GitHub Pages:
774c5ef1fca7ee41b90b10dccc0323b13ffc5e20
---
index.html | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/index.html b/index.html
index 4a6c608..4b9990a 100644
--- a/index.html
+++ b/index.html
@@ -34,16 +34,17 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0185211 0.00847864 1
-lima 0.0323029 0.0103629 1.58023
-serpy 0.0767255 0.0402741 4.33337
-Strainer 0.111886 0.0480838 5.92485
-Toasted Marshmallow 0.147332 0.0805259 8.43926
-Colander 0.460081 0.237314 25.8297
-Lollipop 0.744028 0.349707 40.5091
-kim 1.4407 0.691975 78.9887
-Marshmallow 1.7112 0.871818 95.6683
-Django REST Framework 1.62452 1.11424 101.437
+Custom 0.0134363 0.00623655 1
+lima 0.0156646 0.00784755 1.19515
+serpy 0.0415354 0.0215726 3.20787
+Strainer 0.0664504 0.0329065 5.05045
+Toasted Marshmallow 0.0995898 0.0533848 7.77592
+Colander 0.264328 0.129063 19.9966
+Lollipop 0.363104 0.173901 27.2967
+Marshmallow 0.520532 0.269906 40.1791
+Avro 0.529453 0.267131 40.4915
+kim 0.74872 0.369864 56.8592
+Django REST Framework 0.902153 0.646744 78.7326
The Benchmark
From d918abb849e6c953f6a88dddd18473265662b5c0 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Sun, 7 Jul 2019 17:11:36 +0000
Subject: [PATCH 27/32] Deploy to GitHub Pages:
632dd64e1b07462050d61728f8e236b64edf314e
---
index.html | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/index.html b/index.html
index 4b9990a..50f0a52 100644
--- a/index.html
+++ b/index.html
@@ -34,17 +34,17 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0134363 0.00623655 1
-lima 0.0156646 0.00784755 1.19515
-serpy 0.0415354 0.0215726 3.20787
-Strainer 0.0664504 0.0329065 5.05045
-Toasted Marshmallow 0.0995898 0.0533848 7.77592
-Colander 0.264328 0.129063 19.9966
-Lollipop 0.363104 0.173901 27.2967
-Marshmallow 0.520532 0.269906 40.1791
-Avro 0.529453 0.267131 40.4915
-kim 0.74872 0.369864 56.8592
-Django REST Framework 0.902153 0.646744 78.7326
+Custom 0.01247 0.00598454 1
+lima 0.0176778 0.00955582 1.47571
+serpy 0.0408196 0.0216684 3.38605
+Strainer 0.0658422 0.0328884 5.34993
+Toasted Marshmallow 0.106558 0.0605462 9.05488
+Colander 0.259306 0.127832 20.9779
+Lollipop 0.361919 0.171774 28.9193
+Avro 0.558331 0.262144 44.4592
+Marshmallow 0.557178 0.276278 45.1626
+kim 0.777472 0.397107 63.6472
+Django REST Framework 0.971534 0.728644 92.1278
The Benchmark
From 201a8ef08eafca05e786ff24a08e10d739b19506 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Sun, 7 Jul 2019 17:14:57 +0000
Subject: [PATCH 28/32] Deploy to GitHub Pages:
1a93546aa72707b18ccdab136a19b71b9f27a87f
---
index.html | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/index.html b/index.html
index 50f0a52..7ed6c8b 100644
--- a/index.html
+++ b/index.html
@@ -34,17 +34,18 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.01247 0.00598454 1
-lima 0.0176778 0.00955582 1.47571
-serpy 0.0408196 0.0216684 3.38605
-Strainer 0.0658422 0.0328884 5.34993
-Toasted Marshmallow 0.106558 0.0605462 9.05488
-Colander 0.259306 0.127832 20.9779
-Lollipop 0.361919 0.171774 28.9193
-Avro 0.558331 0.262144 44.4592
-Marshmallow 0.557178 0.276278 45.1626
-kim 0.777472 0.397107 63.6472
-Django REST Framework 0.971534 0.728644 92.1278
+Custom 0.012332 0.00598311 1
+lima 0.0161235 0.00804472 1.31958
+Pickle 0.021558 0.0217698 2.36569
+serpy 0.04213 0.0218706 3.49442
+Strainer 0.0674126 0.0334911 5.50933
+Toasted Marshmallow 0.101972 0.0549827 8.5697
+Colander 0.259778 0.128447 21.197
+Lollipop 0.370258 0.180135 30.0514
+Avro 0.524337 0.262554 42.9641
+Marshmallow 0.551328 0.275338 45.1358
+kim 0.816756 0.384658 65.597
+Django REST Framework 0.963721 0.74473 93.2811
The Benchmark
From 786f24ac52a71b4a6ac534cc72a58107236b5657 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Fri, 24 Jan 2020 07:09:08 +0000
Subject: [PATCH 29/32] Deploy to GitHub Pages:
ee599b910432b5042e6b8c7aed5da7eee71a12de
---
index.html | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/index.html b/index.html
index 7ed6c8b..e39c82f 100644
--- a/index.html
+++ b/index.html
@@ -34,18 +34,18 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.012332 0.00598311 1
-lima 0.0161235 0.00804472 1.31958
-Pickle 0.021558 0.0217698 2.36569
-serpy 0.04213 0.0218706 3.49442
-Strainer 0.0674126 0.0334911 5.50933
-Toasted Marshmallow 0.101972 0.0549827 8.5697
-Colander 0.259778 0.128447 21.197
-Lollipop 0.370258 0.180135 30.0514
-Avro 0.524337 0.262554 42.9641
-Marshmallow 0.551328 0.275338 45.1358
-kim 0.816756 0.384658 65.597
-Django REST Framework 0.963721 0.74473 93.2811
+Custom 0.0104711 0.00514102 1
+lima 0.012804 0.00634384 1.22647
+Pickle 0.0183399 0.0178602 2.31871
+serpy 0.0329423 0.0175877 3.23658
+Strainer 0.0532405 0.0266149 5.11496
+Toasted Marshmallow 0.0841787 0.0451415 8.28331
+Colander 0.217609 0.106181 20.7397
+Lollipop 0.299593 0.142388 28.3101
+Avro 0.423823 0.211522 40.6956
+Marshmallow 0.457737 0.238069 44.5683
+kim 0.65399 0.32078 62.4367
+Django REST Framework 0.784377 0.587458 87.8698
The Benchmark
From df14f2881b0bc3c57e67049319c15b37f1e63261 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Mon, 27 Apr 2020 15:41:17 +0000
Subject: [PATCH 30/32] Deploy to GitHub Pages:
6cbba2c05842b39304906e1e91458f9894c067fb
---
index.html | 68 +++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 49 insertions(+), 19 deletions(-)
diff --git a/index.html b/index.html
index e39c82f..478f5a3 100644
--- a/index.html
+++ b/index.html
@@ -9,14 +9,16 @@ Python Serialization Benchmark
You can find the latest benchmarks on this page.
Currently the following projects are benchmarked.
-- Django REST framework
+- Django REST Framework
- serpy
- Marshmallow
- Strainer
- Lollipop
-- kim
-- toasted-marshmallow
+- Kim
+- Toasted Marshmallow
- Colander
+- Lima
+- Avro
Along with a baseline custom function that doesn't use a framework.
Running the test suite
@@ -34,18 +36,18 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0104711 0.00514102 1
-lima 0.012804 0.00634384 1.22647
-Pickle 0.0183399 0.0178602 2.31871
-serpy 0.0329423 0.0175877 3.23658
-Strainer 0.0532405 0.0266149 5.11496
-Toasted Marshmallow 0.0841787 0.0451415 8.28331
-Colander 0.217609 0.106181 20.7397
-Lollipop 0.299593 0.142388 28.3101
-Avro 0.423823 0.211522 40.6956
-Marshmallow 0.457737 0.238069 44.5683
-kim 0.65399 0.32078 62.4367
-Django REST Framework 0.784377 0.587458 87.8698
+Custom 0.0106766 0.00519919 1
+lima 0.0125217 0.00629926 1.18551
+Pickle 0.0173957 0.0172369 2.18147
+serpy 0.0332184 0.0176816 3.20613
+Strainer 0.0534034 0.0266812 5.04444
+Toasted Marshmallow 0.0825396 0.0447464 8.0176
+Colander 0.215784 0.105959 20.2662
+Lollipop 0.301132 0.143556 28.0104
+Avro 0.413466 0.207327 39.1031
+Marshmallow 0.446715 0.22695 42.4334
+kim 0.629416 0.311557 59.2709
+Django REST Framework 0.781569 0.577704 85.6191
The Benchmark
@@ -99,7 +101,7 @@ Discussion
No
- marshmallow
+ Marshmallow
Yes
Yes
Yes
@@ -113,19 +115,47 @@ Discussion
Yes
- strainer
+ Strainer
Yes
- Yes
+ No
Yes
Yes
- kim
+ Kim
Yes
No
Yes
Yes
+
+ Toasted Marshmallow
+ Yes
+ Yes
+ Yes
+ Yes
+
+
+ Colander
+ Yes
+ No
+ Yes<
+ Yes
+
+
+ Lima
+ Yes
+ No
+ No
+ No
+
+
+ Avro
+ Yes
+ Yes
+ Yes
+ No
+
From e06ecba9114ce9663689603c2aae01166c9061ad Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Tue, 5 Jan 2021 04:20:52 +0000
Subject: [PATCH 31/32] Deploy to GitHub Pages:
d8452fa880756746f1fe874aa24953dda7af01a0
---
index.html | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/index.html b/index.html
index 478f5a3..51a14c6 100644
--- a/index.html
+++ b/index.html
@@ -18,6 +18,7 @@ Python Serialization Benchmark
Toasted Marshmallow
Colander
Lima
+Serpyco
Avro
Along with a baseline custom function that doesn't use a framework.
@@ -36,24 +37,24 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-Custom 0.0106766 0.00519919 1
-lima 0.0125217 0.00629926 1.18551
-Pickle 0.0173957 0.0172369 2.18147
-serpy 0.0332184 0.0176816 3.20613
-Strainer 0.0534034 0.0266812 5.04444
-Toasted Marshmallow 0.0825396 0.0447464 8.0176
-Colander 0.215784 0.105959 20.2662
-Lollipop 0.301132 0.143556 28.0104
-Avro 0.413466 0.207327 39.1031
-Marshmallow 0.446715 0.22695 42.4334
-kim 0.629416 0.311557 59.2709
-Django REST Framework 0.781569 0.577704 85.6191
+serpyco 0.00796366 0.00406694 1
+Custom 0.00985813 0.00479531 1.21801
+lima 0.0123692 0.00617647 1.54154
+Pickle 0.0181735 0.0181575 3.01988
+serpy 0.0357647 0.0186381 4.52204
+Strainer 0.0541008 0.026659 6.71286
+Toasted Marshmallow 0.0879436 0.0476737 11.2727
+Colander 0.230517 0.114572 28.6843
+Lollipop 0.32575 0.156234 40.0632
+Avro 0.442604 0.219167 55.0073
+Marshmallow 0.477782 0.258027 61.1615
+kim 0.616711 0.307592 76.8293
+Django REST Framework 0.779191 0.535238 109.257
-
The Benchmark
Each framework is asked to serialize a list of 2 objects a 1000 times, and then 1 object a 1000 times.
This is the current object that is being serialized.
-class ChildTestObject(object):
+class ChildTestObject(object):
def __init__(self, multiplier=None):
self.w = 1000 * multiplier if multiplier else 100
self.x = 20 * multiplier if multiplier else 20
@@ -72,7 +73,6 @@ The Benchmark
benchmark_object = ParentTestObject()
-
Discussion
Serialization from python objects to JSON, XML, or other transmission formats is a common task for many web related projects. In order to fill that need a number of frameworks have arised. While their aims are similar, they don't all share the same attributes. Here are how some of the features comapre.
@@ -128,6 +128,13 @@ Discussion
Yes
Yes
+
+ serpyco
+ Yes
+ Yes
+ Yes
+ Yes
+
Toasted Marshmallow
Yes
From 42c85bcc4f9cfd32fe238a1a76917b77d92d6c76 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Sun, 7 Feb 2021 22:49:20 +0000
Subject: [PATCH 32/32] Deploy to GitHub Pages:
b45cb024a553e78a81e1a8c5a3056b7b9100baab
---
index.html | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/index.html b/index.html
index 51a14c6..ef32fb9 100644
--- a/index.html
+++ b/index.html
@@ -37,19 +37,19 @@ Running the test suite
Library Many Objects (seconds) One Object (seconds) Relative
--------------------- ------------------------ ---------------------- ----------
-serpyco 0.00796366 0.00406694 1
-Custom 0.00985813 0.00479531 1.21801
-lima 0.0123692 0.00617647 1.54154
-Pickle 0.0181735 0.0181575 3.01988
-serpy 0.0357647 0.0186381 4.52204
-Strainer 0.0541008 0.026659 6.71286
-Toasted Marshmallow 0.0879436 0.0476737 11.2727
-Colander 0.230517 0.114572 28.6843
-Lollipop 0.32575 0.156234 40.0632
-Avro 0.442604 0.219167 55.0073
-Marshmallow 0.477782 0.258027 61.1615
-kim 0.616711 0.307592 76.8293
-Django REST Framework 0.779191 0.535238 109.257
+serpyco 0.00796103 0.00404453 1
+Custom 0.009902 0.00483012 1.22711
+lima 0.012424 0.00625205 1.55562
+Pickle 0.0180094 0.0179398 2.99438
+serpy 0.0356748 0.0189779 4.55228
+Strainer 0.0529356 0.0261641 6.58858
+Toasted Marshmallow 0.0865085 0.0465157 11.0802
+Colander 0.238111 0.116309 29.5214
+Lollipop 0.32454 0.156491 40.0673
+Avro 0.442609 0.220602 55.2419
+Marshmallow 0.496984 0.242603 61.6036
+kim 0.616623 0.307922 77.0097
+Django REST Framework 0.761326 0.527056 107.315
The Benchmark
Each framework is asked to serialize a list of 2 objects a 1000 times, and then 1 object a 1000 times.