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
Checks the best way to do a conditional based on one value.
<script>
var part = "1/1";
var xMax = 300;
var yMax = 300;
var xHalf = xMax / 2;
var yHalf = yMax / 2;
var varGrid = {
'1/1': {
x: 0,
y: 0,
xMax: xMax,
yMax: yMax
},
'1/2': {
x: 0,
y: 0,
xMax: xHalf,
yMax: yMax
},
'2/2': {
x: xHalf,
y: 0,
xMax: xMax,
yMax: yMax
},
'1/4': {
x: 0,
y: 0,
xMax: xHalf,
yMax: yHalf
},
'2/4': {
x: xHalf,
y: 0,
xMax: xMax,
yMax: yHalf
},
'3/4': {
x: 0,
y: yHalf,
xMax: xHalf,
yMax: yMax
},
'4/4': {
x: xHalf,
y: yHalf,
xMax: xMax,
yMax: yMax
}
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
If-Else |
| ready |
Switch-Case |
| ready |
JSON |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.