title: Python pickle protocol choice?
body: <p>I an using python 2.7 and trying to pickle an object. I am wondering what the real difference is between the pickle protocols.</p>
  
  <pre><code>import numpy as np
  import pickle
  
  class Data(object):
    def __init__(self):
      self.a = np.zeros((100, 37000, 3), dtype=np.float32)
  
  d = Data()
  print("data size: ", d.a.nbytes / 1000000.0)
  print("highest protocol: ", pickle.HIGHEST_PROTOCOL)
  pickle.dump(d, open("noProt", "w"))
  pickle.dump(d, open("prot0", "w"), protocol=0)
  pickle.dump(d, open("prot1", "w"), protocol=1)
  pickle.dump(d, open("prot2", "w"), protocol=2)
  
  
  out &gt;&gt; data size:  44.4
  out &gt;&gt; highest protocol:  2
  </code></pre>
  
  <p>then I found that the saved files have different sizes on disk:</p>
  
  <ul>
  <li><code>noProt</code>: 177.6MB  </li>
  <li><code>prot0</code>: 177.6MB  </li>
  <li><code>prot1</code>: 44.4MB  </li>
  <li><code>prot2</code>: 44.4MB</li>
  </ul>
  
  <p>I know that <code>prot0</code> is a human readable text file, so I don't want to use it.
  I guess protocol 0 is the one given by default.</p>
  
  <p>I wonder what's the difference between protocols 1 and 2, is there a reason why I should chose one or another?</p>
  
  <p>What's is the better to use, <code>pickle</code> or <code>cPickle</code>?</p>