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
const array = [
"https://google.com",
"https://www.google.com",
"http://google.com",
"https://google.com"
]
function origKey(url) {
let key = url;
// Remove http:// or https://
key = key.replace(/^https?:\/\//, "");
// Remove www. prefix
key = key.replace(/^www\./, "");
return key.toLowerCase();
}
const arrowKey = (url) =>
url.toLowerCase().replace(/^(https?:\/\/)?(www\.)?/, '')
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| original | | ready |
| arrow | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.