jQuery vs createElement (v60)

Revision 60 of this benchmark created on


Description

Benchmarks from answer on StackOverflow: http://stackoverflow.com/questions/268490/jquery-document-createelement-equivalent/268520

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>' , {text: 'test'})
var page = new Element("div",{id:"projects",class:"page activePage"});
ready
$('<div></div>', {text: 'test'})
$('<div></div>',{ text :'test' })
ready
document.createElement
$(document.createElement('div')).text('test')
ready
$('<div>tekst</div>')
$('<div>tekst</div>')
ready
node = document.createElement("a");node.setAttribute("href", "");node.setAttribute("class", "ui-link-inherit");
node = document.createElement("a");
node.href = "";
node.className = "ui-link-inherit";
ready
$(document.createElement("a"), {"href": "","class": "ui-link-inherit"});
$(document.createElement("a"), {"href": "","class": "ui-link-inherit"});
ready

Revisions

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