Add optional C extension wrapper for Python JSON parsing
authorTerry Wilson <twilson@redhat.com>
Wed, 8 Jun 2016 13:55:14 +0000 (08:55 -0500)
committerBen Pfaff <blp@ovn.org>
Wed, 8 Jun 2016 18:35:17 +0000 (11:35 -0700)
commitc63b04d678aab6e63551f4105d6fc03c195d639e
treeac5bccfb3dcebb9a733f51a0cb3940a814a96bed
parent2c362f17d6f81b7602ac94abb7980fa1e6eb9cee
Add optional C extension wrapper for Python JSON parsing

The pure Python in-tree JSON parser is *much* slower than the
in-tree C JSON parser. A local test parsing a 100Mb JSON file
showed the Python version taking 270 seconds. With the C wrapper,
it took under 4 seconds.

The C extension will be used automatically if it can be built. If
the extension fails to build, a warning is displayed and the build
is restarted without the extension.

The Serializer class is replaced with Python's built-in
JSON library since the ability to process chunked data is not
needed in that case.

The extension should work with both Python 2.7 and Python 3.3+.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Makefile.am
python/automake.mk
python/ovs/_json.c [new file with mode: 0644]
python/ovs/json.py
python/setup.py