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
var link = "http://stackoverflow.com/questions/8498592/extract-root-domain-name-from-string";
var host;
function simple_domain(url)
{
var matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
return matches[1];
}
function simple_domain_2(url2)
{
var matches2 = url2.match(/(?:[\w-]+\.)+[\w-]+/);
return matches2[1];
}
function simple_domain_3(url3)
{
var urlParts = url3.split(/[/?#]/);
return urlParts[0];
}
Ready to run.
Test | Ops/sec | |
---|---|---|
parseUri |
| ready |
anchor |
| ready |
simpledomain |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.