This post was updated on 2016/08/13: added python-rapidjson; updated simplejson and ujson.

A couple of weeks ago after spending some time with Python profiler, I discovered that Python’s json module is not as fast as I expected. I decided to benchmark alternative JSON libraries.

python-cjson, yajl-py and jsonlib are not included in the benchmark, they are not in active development and don’t support Python 3.

simplejson and ujson may be used as a drop-in replacement for the standard json module, but ujson doesn’t support advanced features like hooks, custom encoders and decoders.

You can change your imports this way to use an alternative library: