Compiling the SIMD version of python-rapidjson

A recent task had me taking a look at alternative JSON libraries for the purpose of performance. One of them was python-rapidjson which offered support for SIMD.

Compiling

To get python-rapidjson to compile with SIMD, we need to define one of the SIMD macros, either RAPIDJSON_SSE2, RAPIDJSON_SSE42, or RAPIDJSON_NEON.

  • SSE4.2: CFLAGS="-DRAPIDJSON_SSE42=1 -msse4.2"
CFLAGS="-DRAPIDJSON_SSE42=1 -msse4.2" pip -v install -force-reinstall -no-binary python-rapidjson $(pip freeze | grep python-rapidjson)

The Adventures of Me

The Adventures of Me