$("<div/>") vs default

JavaScript performance comparison

Test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></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
default
var item = document.createElement('div');
item.setAttribute('data-bb-type', 'item');
item.setAttribute('data-bb-title', "Böser Wolf");
item.setAttribute('data-bb-img', 'http://medien.ubitweb.de/bildzentrale/978/355/008/0166.jpg');
item.setAttribute('data-isbn', "9783550080166");
item.innerHTML = "Nele Neuhaus";
pending…
jQuery
var item = $("<div/>", {
  'data-bb-type': 'item',
  'data-bb-title': "Böser Wolf",
  'data-bb-img': 'http://medien.ubitweb.de/bildzentrale/978/355/008/0166.jpg',
  'data-isbn': "9783550080166"
}).text("Nele Neuhaus").html();
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