Performance

This library is written in Cython for a better performance than a pure-Python implementation could give you.

Decoder Performance

The library is a bit slower than the shipped json module for pure JSON data. If you know that your input does not use JSON5 extension, then this library is probably not what you need.

Encoder Performance

The encoder generates pure JSON data if there are no infinite or NaN values in the input, which are invalid in JSON. The serialized data is XML-safe, i.e. there are no cheverons <>, ampersands &, apostrophes ' or control characters in the output. The output is always ASCII regardless if you call pyjson5.encode() or pyjson5.encode_bytes().

Unless you need the advanced settings in pyjson5.Options, most most likely don’t benefit from using this library as an encoder.