[Checkins] SVN: z3c.formjs/trunk/s Switching to cjson as it is apparently faster. I can't think of a

Paul Carduner paulcarduner at gmail.com
Wed May 14 00:50:36 EDT 2008


Log message for revision 86718:
  
  Switching to cjson as it is apparently faster.  I can't think of a
  reason I shouldn't be using cjson.
  

Changed:
  U   z3c.formjs/trunk/setup.py
  U   z3c.formjs/trunk/src/z3c/formjs/ajax.py

-=-
Modified: z3c.formjs/trunk/setup.py
===================================================================
--- z3c.formjs/trunk/setup.py	2008-05-13 20:31:15 UTC (rev 86717)
+++ z3c.formjs/trunk/setup.py	2008-05-14 04:50:34 UTC (rev 86718)
@@ -80,7 +80,7 @@
         'zope.publisher',
         'zope.schema',
         'zope.traversing',
-        'simplejson',
+        'python-cjson',
         ],
     dependency_links = ['http://download.zope.org/distribution'],
     zip_safe = False,

Modified: z3c.formjs/trunk/src/z3c/formjs/ajax.py
===================================================================
--- z3c.formjs/trunk/src/z3c/formjs/ajax.py	2008-05-13 20:31:15 UTC (rev 86717)
+++ z3c.formjs/trunk/src/z3c/formjs/ajax.py	2008-05-14 04:50:34 UTC (rev 86718)
@@ -17,7 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 import sys
-import simplejson
+import cjson
 import zope.component
 import zope.interface
 from zope.publisher.interfaces import NotFound
@@ -50,7 +50,7 @@
         result = self.func(view)
         if type(result) in (dict, list, set):
             try:
-                result = simplejson.dumps(result)
+                result = cjson.encode(result)
             except TypeError:
                 result = str(result)
         return result



More information about the Checkins mailing list