jquery append element test (v2)

Revision 2 of this benchmark created on


Description

Testing wether appending a jQuery object to another jQuery objects yields a performance penalty vs adding a DOM element.

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div id="parent"></div>
<div id="elem"></div>

<script>
  var parent = $('#parent'),
      $elem = $('#elem'),
      elem = $elem[0];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Append a jQuery object
parent.append($elem);
ready
Append a DOM element
parent.append(elem);
ready

Revisions

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