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 stripWWW = (domain) => domain.replace(/^www\./, '');
const stripWWW2 = (domain) => hasWWW(domain) ? domain.slice(4) : domain;
const hasWWW = (value) => value.startsWith('www.');
const hasSubdomain = (value) => value.split('.').length > (hasWWW(value) ? 3 : 2);
const hasSubdomain2 = (value) => stripWWW(value).split('.').length > 2;
const hasSubdomain3 = (value) => stripWWW2(value).split('.').length > 2;
const urls = [
'www.test.cz',
'test.cz',
'sub.test.cz'
];Ready to run.
| Test | Ops/sec | |
|---|---|---|
| hasSubdomain - hasWWW | | ready |
| hasSubdomain - stripWWW regexp | | ready |
| hasSubdomain - stripWWW slice | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.