Skip to content

Improve `rotate` Performance

Compare
Choose a tag to compare
@blakeembrey blakeembrey released this 11 Sep 06:11
· 33 commits to master since this release

Since rotate() is a likely used feature in round-robins and other deque places, inline the behavior to improve overall perf. Based on benchmarks it's running moderately faster than the other two libraries comparable libraries:

@blakeembrey/deque x 207,539,277 ops/sec ±1.02% (95 runs sampled)
denque x 170,141,506 ops/sec ±0.63% (92 runs sampled)
double-ended-queue x 176,605,102 ops/sec ±0.59% (92 runs sampled)