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
<script>
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
encode_py = function(n) {
var s = '',
r, tmp;
while (n != 0) {
tmp = Math.floor(n / 64);
r = n % 64;
n = tmp;
s = alphabet[r] + s;
}
return s;
}
encode_ct = function(a) {
var b = "",
c;
while (a != 0) {
c = a & 63;
a >>>= 6;
b = alphabet[c] + b
}
return b;
}
function encodeNumber(num) {
var encodeString = "";
while (num >= 0x20) {
encodeString += (String.fromCharCode((0x20 | (num & 0x1f)) + 63));
num >>= 5;
}
encodeString += (String.fromCharCode(num + 63));
return encodeString;
}
function encodeSignedNumber(num) {
var sgn_num = num << 1;
if (num < 0) {
sgn_num = ~ (sgn_num);
}
return (encodeNumber(sgn_num));
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Stackoverlow method (from python) |
| ready |
Clicktale method (from script) |
| ready |
Google maps method |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.