argument processing for cache
JavaScript performance comparison
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.
| Test | Ops/sec | |
|---|---|---|
fn1 - single |
|
pending… |
fn2 - single |
|
pending… |
fn1 - multi |
|
pending… |
fn2 - multi |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments