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>
class Queue {
head = null;
tail = null;
enqueue(item) {
const node = {data: item};
if (tail) {
tail.next = item;
item.prev = tail;
tail = item;
} else {
head = tail = item;
}
}
dequeue() {
if (!head) {
return null;
}
const popped = tail;
if (head === tail) {
head = tail = null;
} else {
tail = tail.prev;
}
return popped;
}
}
</script>
var COUNT = 1_000;
var queue = new Queue();
var list = [];
delete COUNT;
delete queue;
delete list;
Ready to run.
Test | Ops/sec | |
---|---|---|
Shift |
| ready |
Queue |
| ready |
Slice |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.