<div> vs. <div/> on jQuery constructor (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
<div>
$('<div>', {
 'class': 'foo',
 'text': 'bar'
}).appendTo(document.body).remove();
ready
<div/>
$('<div/>', {
 'class': 'foo',
 'text': 'bar'
}).appendTo(document.body).remove();
ready
html closed
$('<div class="foo">bar</div>').appendTo(document.body).remove();
ready
multi function
$('<div class="foo"/>').text("bar").appendTo(document.body).remove();
ready
super multi
$('<div/>').addClass("foo").text("bar").appendTo(document.body).remove();
ready
open close super
$('<div></div>').addClass("foo").text("bar").appendTo(document.body).remove();
ready

Revisions

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