JQuery multiple createElement

JavaScript performance comparison

Test case created

Preparation code

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

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Multiple append #1
for (var i = 0; i <= 9; i++) {
  for (var j = 0; j <= 600; j++) {
    $(document.createElement('div')).append("body");
  }
}
pending…
Multiple append #2
for (var i = 0; i <= 9; i++) {
  for (var j = 0; j <= 600; j++) {
    $('<div></div>').append("body");
  }
}
pending…
One appendTo #1
var elements = [];
for (var i = 0; i <= 9; i++) {
  elements = [];
  for (var j = 0; j <= 600; j++) {
    elements[j] = document.createElement('div');
  }
  $(elements).appendTo("body");
}
pending…
One appendTo #2
var elements = [];
for (var i = 0; i <= 9; i++) {
  elements = [];
  for (var j = 0; j <= 600; j++) {
    elements[j] = document.createElement('div').innerHTML;
  }
  document.body.appendChild(document.createTextNode(elements.join('')));
}
pending…

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

Compare results of other browsers

0 comments

Add a comment