# bunqueue v2.4.6

Ships 3 performance improvements and 2 additions. Event-driven dependency resolution - Replaced 100ms setInterval polling with microtask-coalesced flush triggered on job completion.

Canonical: https://bunqueue.dev/blog/bunqueue-v2-4-6/

---

<!-- Generated from changelog.md by docs/scripts/generate-release-posts.ts. Edit the changelog and regenerate. -->

Ships 3 performance improvements and 2 additions. Event-driven dependency resolution - Replaced 100ms setInterval polling with microtask-coalesced flush triggered on job completion.

![](https://github.com/egeominotti.png?size=64) [egeominotti](https://github.com/egeominotti)

#### To install bunqueue v2.4.6

```bash title="bun"
bun add bunqueue@2.4.6
```

```bash title="npm"
npm install bunqueue@2.4.6
```

#### To upgrade bunqueue

```bash
bun add bunqueue@latest
```

## What's new

- `src/benchmark/dependency-latency.bench.ts` - Benchmark for dependency chain resolution latency
- `src/application/taskErrorTracking.ts` - Extracted error tracking for reuse across modules

## Performance

- **Event-driven dependency resolution** - Replaced 100ms `setInterval` polling with microtask-coalesced flush triggered on job completion. Dependency chain latency drops from hundreds of milliseconds to microseconds:

  | Scenario              | Before (P50) | After (P50)  | Speedup      |
  | --------------------- | ------------ | ------------ | ------------ |
  | Single dep (A→B) | 100.05ms     | 12.5&micro;s | **~8,000x**  |
  | Chain (4 levels)      | 300.43ms     | 28.2&micro;s | **~10,700x** |
  | Fan-out (1→5)    | 100.11ms     | 31.0&micro;s | **~3,200x**  |

- The previous 100ms interval is now a 30s safety fallback. Zero functional changes, zero API changes.
- Bonus: less CPU at idle (no more 10 calls/sec to `processPendingDependencies` when queue is empty).

## Thanks to 1 contributor!

- [@egeominotti](https://github.com/egeominotti)

---

[← bunqueue v2.4.5](https://bunqueue.dev/blog/bunqueue-v2-4-5/) · [Release on GitHub](https://github.com/egeominotti/bunqueue/releases/tag/v2.4.6) · [Commits since v2.4.5](https://github.com/egeominotti/bunqueue/compare/v2.4.5...v2.4.6) · [Full changelog](https://bunqueue.dev/changelog/) · [All posts](https://bunqueue.dev/blog/)
