Take a look at orjson https://github.com/ijl/orjson It may help further improved the canonicalization started with this PR https://github.com/bact/pitloom/pull/29