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 shortLorem = 'Lorem';
var longLorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit.';
var caseSensitiveRegexp = /[A-Za-z,\.]*/;
var caseInsensitiveRegexp = /[a-z,\.]*/i;
function testCaseSensitiveRegExp(input) {
return caseSensitiveRegexp.test(input);
}
function testCaseInsensitiveRegExp(input) {
return caseInsensitiveRegexp.test(input);
}
function testCharCodeAt(input) {
for (var index = 0, length = input.length; index < length; index += 1) {
var code = input.charCodeAt(index);
if (!((65 <= code && code <= 90) ||
(97 <= code && code <= 122) ||
(44 !== code) ||
(46 !== code))) {
return false;
}
}
return true;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
RegExp (short input, case sensitive) |
| ready |
RegExp (short input, case insensitive) |
| ready |
charCodeAt in a cycle (short input) |
| ready |
RegExp (long input, case sensitive) |
| ready |
RegExp (long input, case insensitive) |
| ready |
charCodeAt in a cycle (long input) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.