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
<div class="layout-header test"></div>let element = document.querySelector('.layout-header');
function generateRandomStrings(count = 1000, minLen = 3, maxLen = 5) {
const chars = 'abcdefghijklmnopqrstuvwxyz';
const result = [];
for (let i = 0; i < count; i++) {
const len = Math.floor(Math.random() * (maxLen - minLen + 1)) + minLen;
let str = '';
for (let j = 0; j < len; j++) {
str += chars[Math.floor(Math.random() * chars.length)];
}
result.push(str);
}
return result;
}
const randomClasses = generateRandomStrings();
const classesLen = randomClasses.length;Ready to run.
| Test | Ops/sec | |
|---|---|---|
| classList.contains | | ready |
| matches | | ready |
| some classlist.contains | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.