jQuery element creation (v8)

Revision 8 of this benchmark created by jess jacobs on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  $ = jQuery;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
With trailing slash
$('<div/>');
ready
Without trailing slash
$('<div>');
ready
Opening and closing tags
$('<div></div>');
ready
document.createElement
$(document.createElement('div'));
ready
doc.create, then adding a class
$(document.createElement('div')).addClass("blah");
ready
trailing slash, then add class
$('<div/>').addClass("blah");
ready

Revisions

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