v1.0.0
Updates
- add
donemethod which returns a promise that resolves when the queue is empty - add
clearmethod to empty the queue - add
sizemethod to get the total number of promises in the queue - add
activemethod 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