#7131 closed (fixed)
Update simplejson to 1.8.1 for better Unicode support
Reported by: | John Millikin | Owned by: | nobody |
---|---|---|---|
Component: | Core (Serialization) | Version: | dev |
Severity: | Keywords: | simplejson, json, unicode | |
Cc: | mattimustang@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Simplejson 1.8.1 features greatly improved Unicode support and performance over the version included in Django trunk. In particular, the version in trunk mangles astral unicode when serializing.
If it's not feasible to include the most recent version, I would be willing to backport as much as I could to Django's version if that would be preferable.
Attachments (1)
Change History (7)
comment:1 by , 17 years ago
Cc: | added |
---|---|
Has patch: | set |
comment:2 by , 16 years ago
Has patch: | unset |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:3 by , 16 years ago
Triage Stage: | Design decision needed → Accepted |
---|
Jacob and I had a chat about this and we'll do it at some point (moving to the latest version). What will be useful in the interim, however, is if somebody could work out what, if any, backwards incompatibilities there are between simplejson 1.5 and simplejson 1.9 that might affect Django's serialisers. Just drop a note in this ticket with any discoveries so that we can update the wiki page when we make the update.
comment:4 by , 16 years ago
milestone: | → 1.0 beta |
---|
I've had a look through and I can't see any backward incompatibilities and I've dropped simplejson-1.9.2 in as a replacement for django.utils.simplejson in a large application that I have that uses serialization quite heavily and I haven't had any problems. All django tests pass too.
I'll attach a patch to simplejson-1.9.2 to bring it into Django.
We should also note in the serialization docs that you can build the C _speedups.so from the original simplejson source and copy it to django/utils/simplejson to get better serialization performance.
by , 16 years ago
Attachment: | simplejson-1.9.2.patch added |
---|
patch simplejson-1.9.2 to turn it into django.utils.simplejson
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
+1
Except to say that simplejson 1.9.1 is out now.
I'm seeing very poor performance in simplejson 1.5 in Django when it comes to using it in serving RESTful JSON data from my models. Serializing anything more than a dozen objects with a few fields becomes noticeably slow to users. Being able to take advantage of the C "speedups" in the later versions of simplejson would be very beneficial.
Just how to include the module so that users can build the C extension themselves will be tricky.
Two alternatives would be to decouple simplejson from Django as requested in #4843 or change the simplejson import in django.core.serializers.json to be:
Either way would allow users to build their own simplejson and use it.