Commits

Juan BC  committed 136d944

improve performance saving version as cpickle

  • Participants
  • Parent commits 94b2f32

Comments (0)

Files changed (1)

 #===============================================================================
 
 import datetime
-import json
+import cPickle
 import decimal
 
 import peewee
         vdbo.tag = tag
         vdbo.datetime = datetime.datetime.now()
         vdbo.comment = comment
-        vdbo.data = json.dumps(data).encode("base64")
+        vdbo.data = cPickle.dumps(data).encode("base64")
 
         query = self.YatelVersionDBO.select()
         if query.count():
             msg = "Match must be None, int, str, unicode or datetime instance"
             raise TypeError(msg)
 
-        version = json.loads(vdbo.data.decode("base64"))
+        version = cPickle.loads(vdbo.data.decode("base64"))
 
         topology = {}
         for hap_id, xy in version["topology"].items():