gintas / django-picklefield

A pickled object field for Django
MIT License
180 stars 47 forks source link

django-picklefield slow compared to a naive solution using jsonpickle #12

Closed araichev closed 8 years ago

araichev commented 10 years ago

Hi, i use django-picklefield in a project of mine and noticed that it's quite slow compared to pickling an object using jsonpickle (https://github.com/jsonpickle/jsonpickle), storing the result in a TextField, and unpickling the TextField back into a Python object. Do you know what's up with that?

I don't have any benchmarks to show for at present, but i'll make some when i get a chance. Thought i'd raise the issue now, though.

charettes commented 9 years ago

Benchmark would be greatly appreciated since we use the C bindings when available while from I could see jsonpickle is entirely written in Python.

Did you try using the protocol kwarg of PickledObjectField to use the latest version?

Koed00 commented 9 years ago

It also helps to set the protocol to highest. It's not the most compatible mode, but the fastest

PickledObjectField(null=True, protocol=-1)
charettes commented 8 years ago

Closing due to the lack of benchmarks.