oslo.serialization/oslo_serialization
Edan David 1ec85e90cd Use {} instead of dict()
There is a performance impact when using dict() instead of {}
in CPython (up to 6 times longer).
Considering the to_primitive function is recursive this can
have quite an effect.

Measuring:
$ python2.7 -m timeit -n 1000000 -r 5 -v 'dict()'
raw times: 0.24 0.24 0.24 0.239 0.24
1000000 loops, best of 5: 0.239 usec per loop

$ python2.7 -m timeit -n 1000000 -r 5 -v '{}'
raw times: 0.0417 0.0413 0.0407 0.0411 0.042
1000000 loops, best of 5: 0.0407 usec per loop

For more information:
https://doughellmann.com/blog/2012/11/12/
the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2/

Change-Id: Ia0b5892773a19cbabe40313a3bc788580a943f53
2016-06-21 10:58:06 -04:00
..
serializer Unified and simplified API for all serializers 2016-04-04 15:27:16 +03:00
tests Merge "Support serializing ipaddress objs with jsonutils" 2016-06-09 08:18:25 +00:00
__init__.py Move files out of the namespace package 2015-01-05 15:40:06 -05:00
base64.py Use versionadded and versionchanged in doc 2015-10-15 14:38:50 +02:00
jsonutils.py Use {} instead of dict() 2016-06-21 10:58:06 -04:00
msgpackutils.py Replace TypeError by ValueError in msgpackutils 2016-06-08 08:41:36 +00:00