title: Why is a double lookup faster than a single lookup in javascript?
body: <p>I am seeing some odd behavior in a <a href="http://jsperf.com/8dfns4">jsperf</a> test. Here is the setup:</p>
  
  <pre><code>var pro={};
  pro._x=3;
  var q=Object.create(pro);
  q.x=3;
  q.z={};
  q.z.x=3;
  </code></pre>
  
  <p>Then I simply lookup each of the properties <code>q.x</code>, <code>q._x</code>, and <code>q.z.x</code>. </p>
  
  <p>The single lookup <code>q.x</code> is faster than the prototype lookup <code>q._x</code> as expected. But the double lookup <code>q.z.x</code> is the fastest. I expected <code>q.z.x</code> to be the slowest, especially when compared to <code>q.x</code>. </p>
  
  <p><code>q.z.x</code> is even faster than <code>q.z</code>. What is going on here?</p>