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 urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;
var parser = document.createElement('a');
var url = "http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content";
var UrlParser = {
regx: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/
,
get : function(url) {
var matches = this.regx.exec(url);
// map results
return {
href: matches[0],
withoutHash: matches[1],
url: matches[2],
origin: matches[3],
protocol: matches[4],
protocolseparator: matches[5],
credhost: matches[6],
cred: matches[7],
user: matches[8],
pass: matches[9],
host: matches[10],
hostname: matches[11],
port: matches[12],
pathname: matches[13],
segment1: matches[14],
segment2: matches[15],
search: matches[16],
hash: matches[17]
};
}
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Regex |
| ready |
Native |
| ready |
Lib With Regex |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.