title: Why is <= slower than < using this code snippet in V8?
body: <p>I am reading the slides <a href="https://v8-io12.appspot.com/#16" rel="noreferrer">Breaking the Javascript Speed Limit with V8</a>, and there is an example like the code below. I cannot figure out why <code>&lt;=</code> is slower than <code>&lt;</code> in this case, can anybody explain that? Any comments are appreciated.</p>
  
  <p>Slow:</p>
  
  <pre><code>this.isPrimeDivisible = function(candidate) {
      for (var i = 1; i &lt;= this.prime_count; ++i) {
          if (candidate % this.primes[i] == 0) return true;
      }
      return false;
  } 
  </code></pre>
  
  <p>(Hint: primes is an array of length prime_count)</p>
  
  <p>Faster:</p>
  
  <pre><code>this.isPrimeDivisible = function(candidate) {
      for (var i = 1; i &lt; this.prime_count; ++i) {
          if (candidate % this.primes[i] == 0) return true;
      }
      return false;
  } 
  </code></pre>
  
  <p><strong>[More Info]</strong> the speed improvement is significant, in my local environment test, the results are as follows: </p>
  
  <pre><code>V8 version 7.3.0 (candidate) 
  </code></pre>
  
  <p>Slow:</p>
  
  <pre><code> time d8 prime.js
   287107
   12.71 user 
   0.05 system 
   0:12.84 elapsed 
  </code></pre>
  
  <p>Faster:</p>
  
  <pre><code>time d8 prime.js
  287107
  1.82 user 
  0.01 system 
  0:01.84 elapsed
  </code></pre>