jquery vs createElement with class (v4)

Revision 4 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
jquery (HTML)
var test = $('<span class="testClass">');
ready
createElement
var test = $(document.createElement('span'));
test.className = "testClass";
ready
jQuery (Object)
var test = $('<span></span>', {
  'class': 'testClass',
})
ready

Revisions

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