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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<input type="text" id="theInput" value="foo"></input>
<input type="text" id="theInput2" value="foo" testAttr="1234" data-test-attr="1234"></input>
<script>
var el = document.getElementById("theInput");
var el2 = document.getElementById("theInput2");
var $el = $(el);
var $el2 = $(el2);
$el.attr('someAttr', 'theValue').data('someData', 'theValue');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
el.setAttribute |
| ready |
set $el.attr |
| ready |
set $el.data |
| ready |
set $.data |
| ready |
el.getAttribute |
| ready |
get $el.attr |
| ready |
get $el.data |
| ready |
get $.data |
| ready |
get el.attributes.someAttr.value |
| ready |
get data- |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.