Benchmarks
Benchmarks have been tested against the following environment:
Darwin 20.6.0 x64
Node.JS 14.17.1
V8 8.4.371.23-node.67
Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz × 12
1000 items in queue
(3 x shift + 3 x push ops per 'op')
denque x 67,659,118 ops/sec ±0.49% (94 runs sampled)
double-ended-queue x 21,137,935 ops/sec ±0.51% (94 runs sampled)
2 million items in queue
(3 x shift + 3 x push ops per 'op')
denque x 65,145,726 ops/sec ±0.66% (90 runs sampled)
double-ended-queue x 21,171,775 ops/sec ±0.39% (96 runs sampled)
Splice
(1 x splice per 'op') - initial size of 100,000 items
denque.splice x 623,905 ops/sec ±28.11% (71 runs sampled)
native array splice x 10,837 ops/sec ±41.27% (37 runs sampled)