jquery.merge vs push apply (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-2.0.0.min.js"></script>

Setup

var ret = [];
    var $ = window.$;
    var elems = document.getElementsByTagName('div');
    var core_push = Array.prototype.push;

Test runner

Ready to run.

Testing in
TestOps/sec
$.merge
ret.length = 0;
$.merge(ret, elems);
ready
core_push.apply
ret.length = 0;
core_push.apply(ret, elems);
ready

Revisions

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