Skip to content

v1.0.0

Choose a tag to compare

@henrygd henrygd released this 12 Jun 03:06
· 63 commits to main since this release

Updates

  • add done method which returns a promise that resolves when the queue is empty
  • add clear method to empty the queue
  • add size method to get the total number of promises in the queue
  • add active method to get the number of promises currently running

Benchmark

Average of five runs passing Promise.resolve() through the same queue one million times on a Ryzen 7 6800H laptop using Bun 1.1.12.

p-limit is used for comparison because it's the most popular comparable library, with 117 million weekly downloads (!) as of June 2024. I've used it before and it's great.

Also included is the minified bundle size (no gzip) for reference.

Library Version Time (ms) Heap size (MB) Bundle size (B)
@henrygd/queue 1.0.0 512 37.4 352
p-limit 5.0.0 2,276 223.3 1,763

Full Changelog: v0.0.2...v1.0.0