Sets pickle protocol to highest

* package signing protocol is now set to highest. Tests show this to be about a 35% speed increase and there is increased probability of correctly pickling complex objects.

* also upped the protocol on the result database picklefield.
This commit is contained in:
Ilan
2015-08-01 11:41:45 +02:00
parent 9899c42740
commit ed019634d2
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -16,9 +16,9 @@ class Task(models.Model):
name = models.CharField(max_length=100, editable=False)
func = models.CharField(max_length=256)
hook = models.CharField(max_length=256, null=True)
args = PickledObjectField(null=True)
kwargs = PickledObjectField(null=True)
result = PickledObjectField(null=True)
args = PickledObjectField(null=True, protocol=-1)
kwargs = PickledObjectField(null=True, protocol=-1)
result = PickledObjectField(null=True, protocol=-1)
group = models.CharField(max_length=100, editable=False, null=True)
started = models.DateTimeField(editable=False)
stopped = models.DateTimeField(editable=False)
+1 -1
View File
@@ -37,7 +37,7 @@ class PickleSerializer(object):
@staticmethod
def dumps(obj):
return pickle.dumps(obj)
return pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
@staticmethod
def loads(data):