EQ vs filter

Benchmark created by Douglas on


Preparation HTML

<input type="radio" name="test" class="radio" value="1" />
<input type="radio" name="test" class="radio" value="2" />
<input type="radio" name="test" class="radio" value="3" checked="checked" />
<input type="radio" name="test" class="radio" value="4" /><script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var radios = $('.radio');

Test runner

Ready to run.

Testing in
TestOps/sec
EQ
radios.eq(2);
ready
Filter
radios.filter(':checked');
ready

Revisions

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

  • Revision 1: published by Douglas on