title: Fast way to copy dictionary in Python
body: <p>I have a Python program that works with dictionaries a lot. I have to make copies of dictionaries thousands of times. I need a copy of both the keys and the associated contents. The copy will be edited and must not be linked to the original (e.g. changes in the copy must not affect the original.)</p>
  
  <p>Keys are Strings, Values are Integers (0/1).</p>
  
  <p>I currently use a simple way:</p>
  
  <pre><code>newDict = oldDict.copy()
  </code></pre>
  
  <p>Profiling my Code shows that the copy operation takes most of the time.</p>
  
  <p>Are there faster alternatives to the <code>dict.copy()</code> method? What would be fastest?</p>