Creating complex elements

JavaScript performance comparison

Test case created by WTK

Preparation code

<script src="//"></script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Passing full html string to jQuery
var elements = "<div><table><tr><td>1</td><td>2</td></tr></table></div>";
Create elements by hand but still using jQuery
function create() {
  return $("<div>").append($("<table>").append('tr').append('td'));
Using innerHTML
var elements = "<div><table><tr><td>1</td><td>2</td></tr></table></div>";
var div = document.createElement('div') = 'mycustomdiv'
div.innerHTML = elements;

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

1 comment

xyz commented :

Good Result!

Add a comment