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 notAcceptedArray = ['<', '>', '[', ']', '(', ')', ',', ';', '/', '\\', '\'', '"'];
function checkAgainstNotAcceptedArray(str) {
for (var i = 0; i < notAcceptedArray.length; i++) {
if (str.indexOf(notAcceptedArray[i]) > -1)
return false;
};
return true;
};
var notAcceptedRegExp = /[<>\(\)\[\],;\\\/'"]/;
function checkAgainstNotAcceptedRegExp(str) {
return notAcceptedRegExp.test(str);
}
var acceptedRegExp = /^[\w\- ]+$/;
function checkAgainstAcceptedRegExp(str) {
return acceptedRegExp.test(str);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Array success |
| ready |
Array failure from start |
| ready |
Array failure from end |
| ready |
RegExp success against not accepted |
| ready |
RegExp failure against not accepted from start of character set |
| ready |
RegExp failure against not accepted from end character set |
| ready |
RegExp success against accepted |
| ready |
RegExp failure against accepted |
| ready |
RegExp failure against accepted round 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.