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>
function inject1(item, stack) {
for (var i = 0, current; current = stack[i]; i++) {
if (current < item) {
stack.splice(i, 0, item);
break;
}
}
if (!current) {
stack.push(item);
}
}
function inject2(item, stack) {
stack.push(item);
stack.sort();
}
function inject3(item, stack) {
stack.unshift(item);
stack.sort();
}
var array = [];
while (array.length < 1000) {
array.push(Math.random());
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
inject1 |
| ready |
inject2 |
| ready |
inject3 |
| ready |
push |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.