Nick Coghlan <ncoghlan <at> gmail.com> writes:

> Consider trying:
> 
> import sys
> sys.modules["_json"] = 0 # Block the C extension
> import json
> 
> in a fresh interpreter.
> 

Thanks for the tip. The revised script at

https://gist.github.com/924626

shows more believable numbers vis-à-vis the no-speedups case. Interestingly this
morning, stdlib json wins in both cases, though undoubtedly YMMV.

---------------------------------------------------------------------------
(jst3)vinay@eta-natty:~/projects/scratch$ python time_json.py --no-speedups
Python version: 3.2 (r32:88445, Mar 25 2011, 19:28:28)
[GCC 4.5.2]
11.21484375 KiB read
Timing simplejson (without speedups):
4.585145950317383
Timing stdlib json (without speedups):
3.9949100017547607
(jst3)vinay@eta-natty:~/projects/scratch$ python time_json.py
Python version: 3.2 (r32:88445, Mar 25 2011, 19:28:28)
[GCC 4.5.2]
11.21484375 KiB read
Timing simplejson (with speedups):
0.3202629089355469
Timing stdlib json (with speedups):
0.3200039863586426
---------------------------------------------------------------------------

Regards,

Vinay Sajip

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to