jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
A quick test to see if prop('checked')
, is(':checked')
, attr('checked')
or .checked
is faster with Jquery 2.1.4 (version 2015/04/28).
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<input type="checkbox" value="n" name="my-test-checkbox-n" id="my-test-checkbox-n">
<input type="checkbox" value="y" name="my-test-checkbox-y" id="my-test-checkbox-y" checked>
<script>
var $elUnchecked = $('#my-test-checkbox-n');
var $elChecked = $('#my-test-checkbox-y');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
.prop() - Checked - Sync test |
| ready |
.prop() - Checked - Async test |
| ready |
.prop() - Unchecked - Sync test |
| ready |
.prop() - Unchecked - Async test |
| ready |
.is(':checked') - Checked - Sync test |
| ready |
.is(':checked') - Checked - Async test |
| ready |
.is(':checked') - Unchecked - Sync test |
| ready |
.is(':checked') - Unchecked - Async test |
| ready |
attr("checked") - Checked - Sync test |
| ready |
attr("checked") - Checked - Async test |
| ready |
attr("checked") - Unchecked - Sync test |
| ready |
attr("checked") - Unchecked - Async test |
| ready |
.checked - Checked - Sync test |
| ready |
.checked - Checked - Async test |
| ready |
.checked - Unchecked - Sync test |
| ready |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.