Created
April 24, 2015 03:44
-
-
Save vsoch/61a82e7c920468325ea8 to your computer and use it in GitHub Desktop.
Joblib vs Pickle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.externals import joblib | |
import time | |
import numpy | |
import pickle | |
bigarray = numpy.zeros([190,91,190]) | |
bigarray = bigarray.flatten() | |
### Saving | |
start = time.time() | |
joblib.dump(bigarray,"bigarray1.pkl") | |
end = time.time() - start | |
end | |
# 0.31264686584472656 | |
start = time.time() | |
pickle.dump(bigarray,open("bigarray2.pkl","wb")) | |
end = time.time()-start | |
end | |
# 4.827500104904175 | |
### Loading | |
start = time.time() | |
joblib.load("bigarray1.pkl") | |
end = time.time() - start | |
end | |
# 0.47748589515686035 | |
start = time.time() | |
pickle.load(open("bigarray2.pkl","rb")) | |
end = time.time()-start | |
end | |
# 0.7575929164886475 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Vanessa, I had looked at this page quickly on my mobile phone, and thus not noticed that the timing were in. Sorry for the request, which was pointless.