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 j = 0;
var rmd160_K1_1 = function(j) {
return (0 <= j && j <= 15) ? 0x00000000 : (16 <= j && j <= 31) ? 0x5a827999 : (32 <= j && j <= 47) ? 0x6ed9eba1 : (48 <= j && j <= 63) ? 0x8f1bbcdc : (64 <= j && j <= 79) ? 0xa953fd4e : "rmd160_K1: j out of range";
};
var rmd160_K1_2 = function(j) {
if (0 <= j && j <= 15) return 0x00000000;
if (16 <= j && j <= 31) return 0x5a827999;
if (32 <= j && j <= 47) return 0x6ed9eba1;
if (48 <= j && j <= 63) return 0x8f1bbcdc;
if (64 <= j && j <= 79) return 0xa953fd4e;
};
var rmd160_K1_3 = function(j) {
if (0 <= j && j <= 15) return 0x00000000;
else if (16 <= j && j <= 31) return 0x5a827999;
else if (32 <= j && j <= 47) return 0x6ed9eba1;
else if (48 <= j && j <= 63) return 0x8f1bbcdc;
else if (64 <= j && j <= 79) return 0xa953fd4e;
};
var rmd160_K1_4 = function(j) {
switch (true) {
case 0 <= j && j <= 15:
return 0x00000000;
case 16 <= j && j <= 31:
return 0x5a827999;
case 32 <= j && j <= 47:
return 0x6ed9eba1;
case 48 <= j && j <= 63:
return 0x8f1bbcdc;
case 64 <= j && j <= 79:
return 0xa953fd4e;
}
};
j = Math.random * 80 |0;
Ready to run.
Test | Ops/sec | |
---|---|---|
ternary |
| ready |
if |
| ready |
if-else |
| ready |
switch |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.