jQueryVsJS

JavaScript performance comparison

Test case created by davidThomas

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<table>
  <tbody>
    <tr>
      <td>
        Cell one
      </td>
    </tr>
  </tbody>
</table>

Preparation code output

Cell one

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Plain JS
var cell = document.createElement('td');
cell.innerHTML = "This is text inside of the created 'td' DOM node.";
var row = document.createElement('tr');
var tbody = document.getElementsByTagName('tbody')[0];

row.appendChild(cell);
tbody.appendChild(row);
pending…
jQuery
var cell = $('<td />').text("This is text inside of the created 'td' DOM node.");
var row = $('<tr />');
var tbody = $('tbody:first');

row.append(cell).appendTo(tbody);
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