.clone() vs .html() (v4)

Revision 4 of this benchmark created on


Preparation HTML

<div id="container">inner html</div>
<div id="clone"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var clone = $("#clone").clone();

Test runner

Ready to run.

Testing in
TestOps/sec
.clone()
$("#container").html(clone);
ready
.html()
$("div").html('<div id="clone"></div>')
ready

Revisions

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