Boffin Codersdurable_queueby Boffin Coders

Trust

Benchmarks

What the durable_queue packages cost: storing a task, running it, recovering after a crash, and working with a long history. The numbers below come from one run of the Benchmarks workflow on GitHub's hosted runners, at commit 0c61136 (27 October 2026).

Method

Results

Enqueue

2,000 calls to enqueue per round, each until the task is stored.

Storage Ubuntu: median Ubuntu: p95 macOS: median macOS: p95
Memory 27 µs 56 µs 9 µs 50 µs
SQLite 224 µs 444 µs 157 µs 450 µs
SQLite + encryption 249 µs 399 µs 183 µs 439 µs
Hive 307 µs 412 µs 215 µs 550 µs
Hive (no flush) 73 µs 94 µs 63 µs 232 µs

Running tasks

drain runs 5,000 stored tasks, one at a time (maxConcurrentTasks: 1). Each task is claimed and then completed in storage, so it costs two writes.

Storage Ubuntu: time Ubuntu: per second macOS: time macOS: per second
Memory 75.5 ms 66,266 121 ms 41,175
SQLite 3.14 s 1,591 2.90 s 1,723
SQLite + encryption 3.47 s 1,440 3.29 s 1,522
Hive 2.95 s 1,695 2.40 s 2,080
Hive (no flush) 831 ms 6,014 1.18 s 4,239

Recovery after a crash

10,000 stored tasks, 1,000 of them left running by a crash. Open the storage, then start, which records each interrupted attempt and schedules a retry.

Storage Ubuntu: open Ubuntu: start macOS: open macOS: start
Memory — 9.86 ms — 6.01 ms
SQLite 1.15 ms 266 ms 2.15 ms 581 ms
SQLite + encryption 1.26 ms 325 ms 1.98 ms 463 ms
Hive 148 ms 289 ms 156 ms 254 ms
Hive (no flush) 153 ms 71.0 ms 163 ms 73.7 ms

A long history

100,000 completed tasks and 1,000 pending ones. Open the storage, find the next task to run (1,000 calls, timed in batches of 10), then run the 1,000 pending tasks.

Storage Ubuntu: open Ubuntu: next task Ubuntu: run 1,000 macOS: open macOS: next task macOS: run 1,000
Memory — 0.10 µs 25.2 ms — 0.10 µs 27.6 ms
SQLite 1.13 ms 21 µs 611 ms 1.95 ms 15 µs 492 ms
SQLite + encryption 1.27 ms 31 µs 724 ms 1.36 ms 22 µs 416 ms
Hive 1.55 s 0.10 µs 572 ms 1.41 s 0.10 µs 323 ms
Hive (no flush) 1.55 s 0.10 µs 162 ms 1.45 s 0.10 µs 136 ms

What the numbers say

Numbers vary between machines and runs. To compare two versions, run both on the same machine.

This page is docs/benchmarks.md in the repository. Suggest a change.