Adding _.bind

JavaScript performance comparison

Revision 44 of this test case created by

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
<script>
function foo(){}
</script>
      
<script>
Benchmark.prototype.setup = function() {
  var test1, a = [], b = {}, c = '123';
  
  function _test1(a,b,c) {
    return a,b,c;
  }
  
  test1 = _test1.bind(undefined, a, b, c);
  
  function test2() {
    return a, b, c
  };
  
  
  
  

};
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
bind call

test1();
pending…
closure call
test2();
pending…
bind
test1 = _test1.bind(undefined, a, b, c);
pending…
closure
function test2() {
  return a, b, c
};
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments