serializer: Add comment about simplejson vs. built-in json
authorMichael Hanselmann <hansmi@google.com>
Mon, 26 Sep 2011 09:47:30 +0000 (11:47 +0200)
committerMichael Hanselmann <hansmi@google.com>
Mon, 26 Sep 2011 10:06:12 +0000 (12:06 +0200)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/serializer.py

index ff27261..0a411b1 100644 (file)
@@ -29,9 +29,15 @@ backend (currently json).
 # C0103: Invalid name, since pylint doesn't see that Dump points to a
 # function and not a constant
 
-import simplejson
 import re
 
+# Python 2.6 and above contain a JSON module based on simplejson. Unfortunately
+# the standard library version is significantly slower than the external
+# module. While it should be better from at least Python 3.2 on (see Python
+# issue 7451), for now Ganeti needs to work well with older Python versions
+# too.
+import simplejson
+
 from ganeti import errors
 from ganeti import utils