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
Compares the performance of attrhooks vs the old attr
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js"></script>
<script>
var oldAttr = jQuery.noConflict();
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js">
<script>
var newAttr = jQuery.noConflict();
</script>
<div id="testDiv"></div>
<input type="text" id="someInput" value="foo">
<script>
var oldDiv = oldAttr('#testDiv'),
oldInput = oldAttr('#someInput'),
newDiv = newAttr('#testDiv'),
newInput = newAttr('#someInput');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
oldDiv.attr('id') |
| ready |
newDiv.attr('id') |
| ready |
oldInput.attr('value') |
| ready |
newInput.attr('value') |
| ready |
oldDiv.attr('class', 'wowzers') |
| ready |
newDiv.attr('class', 'wowzers') |
| ready |
oldInput.attr('foo', 'bar') |
| ready |
newInput.attr('foo', 'bar') |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.