Skip to content

Releases: henrygd/queue

v1.0.7

17 Oct 22:32
Compare
Choose a tag to compare

Exports Queue interface to prevent "is using name 'Queue' from external module" TypeScript error

Full Changelog: v1.0.6...v1.0.7

v1.0.6

26 Jun 21:44
Compare
Choose a tag to compare

Performance improvements in V8

Full Changelog: v1.0.5...v1.0.6

v1.0.5

24 Jun 23:13
Compare
Choose a tag to compare

Updates

  • Improved performance

Notes

Benchmark tests have been changed so that every library uses the exact same test.

promise-queue and p-limit don't provide a promise that resolves when the queue is empty, so I was using Promise.all with an array of jobs. Which is how you use them in real life. But it's a slight performance hit and I don't want the tests to be different.

The updated results are in the readme.

Full Changelog: v1.0.4...v1.0.5

v1.0.4

18 Jun 20:27
Compare
Choose a tag to compare

Adds CommonJS modules

Full Changelog: v1.0.3...v1.0.4

v1.0.3

15 Jun 23:22
Compare
Choose a tag to compare

No new features or fixes. Just refactoring and adding new benchmarks like this one:

Cloudflare Workers benchmark

Library Requests/sec Total (sec) Average Slowest
@henrygd/queue 622.7809 1.6057 0.0786 0.1155
promise-queue 324.8053 3.0788 0.1512 0.2174
async.queue 203.9315 4.9036 0.2408 0.3450
fastq 184.0524 5.4332 0.2670 0.3546
queue 86.4867 11.5625 0.5672 0.7636
p-limit 67.5275 14.8088 0.7274 1.0657

Full Changelog: v1.0.2...v1.0.3

v1.0.2

15 Jun 02:53
Compare
Choose a tag to compare
  • queue.done can now be invoked in different contexts simultaneously
  • General refactoring. Library is now at 332 bytes :)
  • Added fastq and async.queue to the benchmark

Full Changelog: v1.0.1...v1.0.2

@henrygd/queue - 9,905 Ops/s. promise-queue - 5,335 Ops/s. fastq - 4,270 Ops/s. async.queue - 3,811 Ops/s. p-limit - 1,000 Ops/s. queue - 686 Ops/s

v1.0.1

14 Jun 03:26
Compare
Choose a tag to compare

Updates

  • Add support for AsyncLocalStorage
  • Refactor queue.done() implementation. Bundle now down to 342 bytes. :)
  • Update benchmarks

Full Changelog: v1.0.0...v1.0.1

v1.0.0

12 Jun 03:06
Compare
Choose a tag to compare

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

v0.0.2

10 Jun 03:19
Compare
Choose a tag to compare
  • Add to JSR
  • Improve types and docs

Full Changelog: v0.0.1...v0.0.2

v0.0.1

10 Jun 01:43
Compare
Choose a tag to compare

Tiny async queue with concurrency control. Like p-limit, queue, or promise-queue, but a lot smaller.