Diez B. Roggisch schrieb: > Thomas Heller wrote: > >> Python 2.6 contains the json module, which I thought was the renamed (and >> improved?) simplejson module that also works on older Python versions. >> >> However, it seems the json is a lot slower than simplejson. >> This little test, run on Python 2.6.2 and WinXP shows a dramatic >> difference: >> >> C:\>py26 -m timeit -s "from json import dumps, loads" >> "loads(dumps(range(32)))" 1000 loops, best of 3: 618 usec per loop >> >> C:\>py26 -m timeit -s "from simplejson import dumps, loads" >> "loads(dumps(range(32)))" 10000 loops, best of 3: 31 usec per loop >> >> Does anyone have an explanation for that? > > Dunno about json, but simplejson comes with an (optional) C-based > speedup-module. > > Maybe this isn't part of the standard distribution?
json has it's own _json speedup module. And funny, on Linux, json WITH _json is still somewhat slower (~10%) than simplejson WITHOUT the _speedups module. Thomas -- http://mail.python.org/mailman/listinfo/python-list