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 a = Array(1008);
a[1001] = function(b, c) {
for (var l = 1000; l > 0; l--) {
this[l] = (this[1000 - l] ? this[1000 - l] : 0) + Math.random() > 0.5 ? b : c;
}
};
a[1002] = function(b, c) {
for (var l = 1000; l > 0; l--) {
a[l] = (a[1000 - l] ? a[1000 - l] : 0) + Math.random() > 0.5 ? b : c;
}
};
a[1003] = function(b, c) {
for (var l = 1000, t = a; l > 0; l--) {
t[l] = (t[1000 - l] ? t[1000 - l] : 0) + Math.random() > 0.5 ? b : c;
}
};
a[1004] = function(b, c) {
var t = a;
for (var l = 1000; l > 0; l--) {
t[l] = (t[1000 - l] ? t[1000 - l] : 0) + Math.random() > 0.5 ? b : c;
}
};
a[1005] = function(b, c) {
var x = 252,
y = 25214,
z = 234,
v = 324234,
s = 234234,
u = 243234;
for (var l = 1000; l > 0; l--) {
a[l] = (a[1000 - l] ? a[1000 - l] : 0) + Math.random() > 0.5 ? b : c;
}
};
a[1006] = function(b, c) {
var x = 252,
y = 25214,
z = 234,
v = 324234,
s = 234234,
u = 243234;
for (var l = 1000; l > 0; l--) {
this[l] = (this[1000 - l] ? this[1000 - l] : 0) + Math.random() > 0.5 ? b : c;
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Using this |
| ready |
using normal name |
| ready |
chaceing with t (best case) |
| ready |
chaceing with t (more realistic case) |
| ready |
Using this (many vars) |
| ready |
using normal name (many vars) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.