Wrap vs clone

Benchmark created by Ivan on


Preparation HTML

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

Setup

var e = $("<div>Hello world</div>");

Test runner

Ready to run.

Testing in
TestOps/sec
clone/append
var f = $("<div class='test'>");
f.append(e.clone());
ready
wrap/unwrap
var f = $("<div class='test'>");
e.wrap(f);
e.unwrap(f);
ready

Revisions

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