aiohttp-jsonrpc
aiohttp-jsonrpc copied to clipboard
Drop py2json
I use ujson as a dumper/loader due to performance reasons. But for large objects (depth) py2json becomes a bottleneck.
Since functionality of py2json is strictly a dumper thing, what do you say to drop double "encoding" - remove py2json from _parse_json. One could still use it by
JSONRPCView.DUMPS = lambda data: json.dumps(py2json(data))
or even introduce custom dump method in common/utils.
Of course I could override _parse_json but it is consider private and secondly you nicely expose class properties to customize DUMPS and LOADS.
I can provide PR. Currently I'm working on handler to throw errors according to spec.