Big Checkbox Test

Benchmark created on


Description

Test various options for creating checkboxes, and linking them together with events.

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<table>
  <tr>
    <td>
      <input type="checkbox" class="cb rid-1" />
    </td>
    <td>
      <input type="checkbox" class="cb rid-2" />
    </td>
    <td>
      <input type="checkbox" class="cb rid-3" />
    </td>
    <td>
      <input type="checkbox" class="cb rid-4" />
    </td>
    <td>
      <input type="checkbox" class="cb rid-5" />
    </td>
    <td>
      <input type="checkbox" class="cb rid-6" />
    </td>
    <td>
      <input type="checkbox" class="cb rid-7" />
    </td>
  </tr>
</table>

Test runner

Ready to run.

Testing in
TestOps/sec
Test1
var $dummy = $('<input type="checkbox" class="dummy-checkbox" disabled="disabled" checked="checked" />').attr('title', 'this is some title').hide();

$('input:checkbox')
  .addClass('real-checkbox')
  .each(function() {
    $dummy.clone().insertAfter(this);
  });

/*
$(':checkbox:not(.rid-2,.rid-1)', this).addClass('real-checkbox').each(function() {
  $dummy.clone().insertAfter(this);
}
*/
ready
Test2
var $dummy = $('a');
ready

Revisions

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