invocation

JavaScript performance comparison

Test case created by Igor Soarez

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var ctx = { x: 1 };
    var p1 = 'alpha';
    var p2 = 'beta';
   
    function f() { return this.x; }
   
    var g = f.bind(ctx);
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
bound
g(p1, p2);
pending…
bind
var h = f.bind(ctx);

h(p1, p2);
pending…
call
f.call(ctx, p1, p2);
pending…
apply
f.apply(ctx, [p1, p2])
pending…

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

Compare results of other browsers

0 comments

Add a comment