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 t = 'true', T = 'TRUE', f = 'false', F = 'FALSE';
var jsonize = function(s){
return JSON.parse(s.toLowerCase());
};
String.prototype.bool = function() {
return (/^true$/i).test(this.toLowerCase());
};
var proto = function(s){
return s.bool();
};
var equalize = function(s){
return (s.toLowerCase() === true);
}
Boolean.parse = function (str) {
switch (str.toLowerCase ()) {
case "true":
case 1:
return true;
case "false":
case 0:
return false;
}
};
var parser = function(s){
return Boolean.parse(s);
}
var universal = function(s){
var num = +s;
return !isNaN(num) ? !!num : !!String(s).toLowerCase().replace(!!0,'');
}
var test = function(fu){
fu(t); fu(T); fu(f); fu(F);
};
Ready to run.
Test | Ops/sec | |
---|---|---|
jsonize |
| ready |
proto |
| ready |
equalize |
| ready |
parser |
| ready |
universal |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.