jquery performance tests

Benchmark created by carlo on


Preparation HTML

<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
<div id="container"></div>

Setup

var html = '';
    for (i = 0; i < 100; i++) {
      var _class = 'class1';
      if (i > 50) {
        _class = 'class2';
      }
      html += '<input type="text" id="' + i + '" class="' + _class + '" value="' + i + '"/ >';
      html += '<input type="checkbox" id="chk_' + i + '" class="' + _class + '" / >';
    }
    $('#container').html(html);

Teardown


    $('#container').html('');
  

Test runner

Ready to run.

Testing in
TestOps/sec
input text selector
$('#container').find('[type="checkbox"]');
ready
input selector
$('#container [type="checkbox"]');
ready

Revisions

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