1. 15 Jul, 2015 2 commits
    • bmeurer's avatar
      [handles] Sanitize Handle and friends. · d940c6d3
      bmeurer authored
      Bunch of cleanups to allow us to get rid of handles-inl.h at some
      point (in the not so far future); but more importantly to sanitize uses
      of handles and prepare for handle canonicalization support.
      
      R=yangguo@chromium.org
      
      Committed: https://crrev.com/3283195d0408333cce552cf4087577e6f41054e5
      Cr-Commit-Position: refs/heads/master@{#28222}
      
      Review URL: https://codereview.chromium.org/1128533002
      
      Cr-Commit-Position: refs/heads/master@{#29666}
      d940c6d3
    • littledan's avatar
      Optimize String.prototype.includes · d20a5090
      littledan authored
      This patch removes the MathMax call from String.prototype.includes
      in order to improve performance. With some quick and dirty benchmarking,
      (test case courtesy of the node folks) a sizable performance gain is visible:
      
      d8> function testIndexOf() { var stringArray = [ 'hello', 'world', '123', 'abc' ]; return stringArray.some(function(val, idx, arr) { return val.indexOf('world') !== -1 })}
      d8> function testIncludes() { var stringArray = [ 'hello', 'world', '123', 'abc' ]; return stringArray.some(function(val, idx, arr) { return val.includes('world') })}
      d8> function testTime(fn) { var before = Date.now(); fn(); return Date.now() - before; }
      d8> testTime(function() { for (var i = 0; i < 10000000; i++) { testIncludes() } })
      2244
      d8> testTime(function() { for (var i = 0; i < 10000000; i++) { testIndexOf() } })
      2212
      
      Compare that to before the test, when the performance difference was much larger:
      
      d8> testTime(function() { for (var i = 0; i < 10000000; i++) { testIndexOf() } })
      2223
      d8> testTime(function() { for (var i = 0; i < 10000000; i++) { testIncludes() } })
      2650
      
      In my runs, performance of both functions drifts up and down, but running them in quick
      succession back and forth shows a roughly consistent delta of about this magnitude.
      
      String.prototype.includes is still slightly (maybe 5%) slower than String.prototype.indexOf,
      but the effect is significantly reduced.
      
      R=adamk
      BUG=v8:3807
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1231673008
      
      Cr-Commit-Position: refs/heads/master@{#29665}
      d20a5090
  2. 14 Jul, 2015 37 commits
  3. 13 Jul, 2015 1 commit