jQuery vs createElement + classes + content (v102)

Revision 102 of this benchmark created by allihov on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
$('<div>')
var d = $('<div class="rating-point active">&#9733;</div>')
ready
createElement + Html
var d = $(document.createElement('div'));
d.addClass('rating-point active').html('&#9733;');
ready
createElement + text
var d = $(document.createElement('div'));
d.addClass('rating-point active').text('&#9733;');
ready
createElement + js content
var d = $(document.createElement('div')
.appendChild(document.createTextNode('&#9733;')));
d.addClass('rating-point active');
ready
full JS
var d = $(document.createElement('div')
.appendChild(document.createTextNode('&#9733;'))
.className = 'rating-point active');
ready

Revisions

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