flat-push
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
function apply(array, items){
array.push.apply(array, items)
}
function loop(array, items){
var i = 0,
l = items.length,
nl = array.length;
for(; i < l; i++)
array[nl++] = items[i];
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
apply |
|
pending… |
loop |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments