My company uses TG1.5 with lots of json in our web app. We were rather
dismayed recently to find that a new deployment was significantly
slower and less responsive than the others. After much profiling and a
little hair pulling we discovered that version 1.3.1 of TurboJson
stopped using simplejson except for versions of python before 2.6. So
the new deployment, which had this version, was using the native json
library, which is much, much slower.
I certainly support removing the dependency, but I suggest that the
import check used in TurboJson should work the other way. Right now it
is:
try:
from json import JSONEncoder
except ImportError: # Python < 2.6
from simplejson import JSONEncoder
I believe it should be reversed:
try: # Python < 2.6, or external simplejson is available
from simplejson import JSONEncoder
except ImportError: # Python 2.6 without external simplejson library
from json import JSONEncoder
This way it will take advantage of the performance of the external
simplejson library if it is available.
Thoughts?
Thanks!
Nathan
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.