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
Which way if faster to check for a given path in an anchor tag href attribute
<a id="lnk1" href="https://www.google.com/search?q=puppies&rlz=1CAVLER_enUS922&oq=puppi&gs_lcrp=EgZjaHJvbWUqCQgAECMYJxiKBTIJCAAQIxgnGIoFMgsIARBFGCcYORiKBTIGCAIQRRg8MgYIAxBFGDwyBggEEEUYPDIGCAUQRRg8MgYIBhBFGDwyBggHEEUYPNIBCDEwNjNqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8">Google Puppies</a>
<a id="lnk2" href="https://mmm.google.com/finder?q=puppies&rlz=1CAVLER_enUS922&oq=puppi&gs_lcrp=EgZjaHJvbWUqCQgAECMYJxiKBTIJCAAQIxgnGIoFMgsIARBFGCcYORiKBTIGCAIQRRg8MgYIAxBFGDwyBggEEEUYPDIGCAUQRRg8MgYIBhBFGDwyBggHEEUYPNIBCDEwNjNqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8">Google Puppies</a>
const lnk1 = document.getElementById('lnk1');
const lnk2 = document.getElementById('lnk2');
const reLnk = /^https:\/\/www\.google\.com\/search\?.*/;
Ready to run.
Test | Ops/sec | |
---|---|---|
IndexOf |
| ready |
RegExp |
| ready |
URL |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.