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 partsOneDim = []
var partsMultiDim = []
var partsObj = []
var count = 200e3
function populateOneDim(a, count) {
for(var i = 0; i < count; i++) {
a[i*4] = Math.random()*10
a[i*4 + 1] = Math.random()*10
a[i*4 + 2] = Math.random()*10
a[i*4 + 3] = Math.random()*10
}
}
function populateMultiDim(a, count) {
for(var i = 0; i < count; i++) {
a[i] = [
Math.random()*10,
Math.random()*10,
Math.random()*10,
Math.random()*10
]
}
}
function populateObj(a, count) {
for(var i = 0; i < count; i++) {
a[i] = {
x: Math.random()*10,
y: Math.random()*10,
z: Math.random()*10,
f: Math.random()*10
}
}
}
populateOneDim(partsOneDim, count)
populateMultiDim(partsMultiDim, count)
populateObj(partsObj, count)
Ready to run.
Test | Ops/sec | |
---|---|---|
One dimension |
| ready |
2 dimension |
| ready |
Objects |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.