HTML element creation test

JavaScript performance comparison

Test case created by Hitesh Aneja

Preparation code

<script src=""></script>

<div id="myDiv"></div>
Benchmark.prototype.setup = function() {
    var html = "";

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
string operation
html = "<div id='myId'>";
html += "Parent Div";
html += "<div id='myId'>child div</div>";
html += "</div>";
with functions
var container = $(document.createElement("div"))
container.html("parent div");
var child = $(document.createElement("div"));
child.html("child div");

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

Compare results of other browsers


Comment form temporarily disabled.

Add a comment