jQuery inline vs create with addClass (v291)

Revision 291 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
$('<div>').addClass('test')
$('<div>').addClass('test')
ready
$('<div class="test"></div>')
$('<div>', {class : 'test'})
ready
document.createElement
$(document.createElement('div')).addClass('test')
ready

Revisions

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