argument processing for cache

JavaScript performance comparison

Test case created by John Cockrell

Preparation code

<script src="http://sjhcockrell.s3.amazonaws.com/downloads/belt.js"></script>
 
<script>
Benchmark.prototype.setup = function() {
    var array = [1,2,3,4],
        in1 = [2,3,4,5,6],
        in2 = [3,4,5,6,7];
   
    // Belt
    function fn1(){
        return arguments[2] ?
                 B.native_concat(B.native_slice.call(arguments, 1)) :
                 arguments[1];
                 
    }
   
    function fn2() {
        return B.native_concat.apply(B.ArrayInstance, arguments);
    }
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
fn1 - single
fn1(array, in1);
pending…
fn2 - single
fn2(array, in1);
pending…
fn1 - multi
fn1(array, in1, in2);
pending…
fn2 - multi
fn2(array, in1, in2);
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