title: Is python dict very slow for searching key?
body: <p>In the code below, rel_column is a string, and 'id_map' is a python dict and it has 2.2 million key-value pair.</p>
  <pre><code>if rel_column in id_map:
     node_ids = id_map[rel_column]
  </code></pre>
  <p>In debugging a speed bottleneck issue, my colleague said that this piece of code is the cause of the slowness. He said that the 'if' statement takes log(n) time, but my impression has been that for searching a key in a map or set, the complexity has been constant time O(1). Considering that the the total size is only 2.2 millions of the dict, this should not be the speed bottleneck.</p>
  <p>I am confused. Is my colleague right?</p>