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
Testing the performance of retrieving data from a script's URL versus from a script's data- attributes. Normally, this would be done within the included script, but a fake external script is used here to simplify the tests.
<div id="fakeScript">
</div>
<script>
var fakeScript = document.getElementById('fakeScript'),
fakeSrc = 'http://example.com/#';
for (var i = 0; i < 20; ++i) {
fakeSrc += i + '=' + i + '&';
fakeScript.setAttribute('data-' + i, i);
}
fakeScript.setAttribute('data-src', fakeSrc);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Parsing the URL |
| ready |
Reading data- Attributes |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.