I've had the understanding that simplejson is much faster than the native json in Python, such as this thread: What are the differences between json and simplejson Python modules?
However, I was just thrown for a loop when I read in App Engines documentation that with Python 2.7
Uses the native JSON library, which is much faster than simplejson.
http://code.google.com/appengine/docs/python/python27/newin27.html
So now I'm confused. Everywhere else it seems to say simplejson is better, but now App Engine with Python 2.7 says the native is faster. What gives?
Before the release of the Python 2.7 runtime, nearly every module included with App Engine, and literally every module you could include yourself were pure python. With the 2.7 release, the json
module includes speedups written in C, making it much faster than any simplejson
you can run on App Engine.
The benefits to using simplejson
on 2.7 you get normally (mainly having a version that's newer than it was when the latest release of Python 2.7 was made) don't apply, since you can't compile the speedups in the latest version and deploy them to App Engine.
I found myself forced to do a straight import json
when I migrated to python 2.7. In my app I had to change from simplejson to this. You might find it generally recommendable to keep maximum compatibility with your "main component" and I consider python 2.7 one of my project's main uses / components where the others are Jinja2, WTForms and the i18n translations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With