Why are you not using save_pickle here? It is much faster as well as it is using the highest priority protocol for pickling.