3 ms·
I've only used simplejson. A mapreduce job could be reading billions of lines and possibly doing very simple logic on each line, so the parsing/encoding is a bi
by gdulli 11y ago
I've only used simplejson. A mapreduce job could be reading billions of lines and possibly doing very simple logic on each line, so the parsing/encoding is a big percentage of the processing, sometimes nearly all of it. I'll try 4.0 and see how it does now.
- fijal 11y agoTry builtin json instead of simplejson for pypy (it's API-equivalent)
- dorfsmay 11y agoOn big jobs (millions of json input/output) I have found ujson significantly faster than json + pypy.
- fijal 11y agoyop, as I said, ujson is probably your best bet if all you do is parse json.
- sontek 11y agoIf you are on python3 python-rapidjson is faster and safer than uJSON: https://github.com/kenrobbins/python-rapidjson https://github.com/kenrobbins/python-rapidjson >>> data2 = 1.23456789e-13 >>> rapidjson.loads(rapidjson.dumps(data2)) 1.23456789e-13 >>> ujson.loads(ujson.dumps(data2)) 0.0