import sys import time if sys.version_info[0] == 2: import cPickle as pickle else: import pickle lst = [0]*10**6 f = open("tst", "wb") t = time.time() pickle.dump(lst, f, protocol=2) print(time.time()-t) f.close() f = open("tst", "rb") t = time.time() pickle.load(f) print(time.time()-t) f.close()