Adds support for using the in-tree C JSON parser in Python. It also uses the built-in Python JSON parser for serialization. In a test of parsing a 100Mb JSON file, this patch improves performance by 70x. This version corrects the code formatting issues with the previous version.
I'm having trouble figuring out the best way to ensure that the PY2/3 C extensions are built locally for when tests are run. I think I just need to run $(PYTHON)/$(PYTHON3) setup.py build_ext --inplace, but I'm not exactly where to make the change. The parsing is slightly different between the pure-Python and wrapped versions, so theoretically I'd need tests to handle both cases. Anyone have any ideas? Terry Wilson (2): Add optional C extension wrapper for Python JSON parsing JSON serialization via Python's json lib Makefile.am | 2 +- python/automake.mk | 3 + python/ovs/_json.c | 266 +++++++++++++++++++++++++++++++++++++++++++++++++++++ python/ovs/json.py | 117 +++++------------------ python/setup.py | 51 +++++++++- tests/json.at | 38 ++++++-- 6 files changed, 370 insertions(+), 107 deletions(-) create mode 100644 python/ovs/_json.c -- 1.8.3.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev