Releases: henrygd/queue
v1.0.7
v1.0.6
Performance improvements in V8
Full Changelog: v1.0.5...v1.0.6
v1.0.5
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
Adds CommonJS modules
Full Changelog: v1.0.3...v1.0.4
v1.0.3
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
queue.done
can now be invoked in different contexts simultaneously- General refactoring. Library is now at 332 bytes :)
- Added
fastq
andasync.queue
to the benchmark
Full Changelog: v1.0.1...v1.0.2
v1.0.1
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
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
- Add to JSR
- Improve types and docs
Full Changelog: v0.0.1...v0.0.2