Skip to content

Benchmark huey beside the other queues - #91

Merged
codingjoe merged 2 commits into
mainfrom
codingjoe-add-huey-benchmarks
Oct 8, 2026
Merged

codingjoe merged 2 commits into
mainfrom
codingjoe-add-huey-benchmarks

Conversation

@codingjoe

Copy link
Copy Markdown
Owner

The comparison benchmarks cover Celery, dramatiq, django-tasks-db and django-tasks-rq, but not huey. Huey is a widely used lightweight queue, so the throughput chart should rank it beside the others.

  • Add benchmarks/huey_app.py with a RedisHuey app, an echo task and a sentinel task.
  • Run the huey consumer as one process with one thread, like the celery and dramatiq workers, and stop it once the sentinel task proves the queue drained. --graceful-signal=TERM makes SIGTERM stop it gracefully.
  • Delete the huey.* queue, results, schedule and counter keys in the queue cleanup.
  • List huey in the chart footnote with the queues that read one task at a time. The Redis storage of huey pops a single message and has no read-ahead setting.
  • Add huey to the test dependency group.
  • Regenerate both chart SVGs and the README alt text. Huey lands third at 6,038 tasks/s, behind threadmill (9,960) and dramatiq (7,177), and ahead of celery (2,280) and django-tasks-db (2,065).

One thing to review: the threadmill row measures 9,960 tasks/s against 11,977 in the previous chart. It is the row that coverage tracing and the one-second start cost hit hardest, because its worker runs in-process and its drain is only about 8 seconds. The other four earlier rows reproduce within 6%.

- benchmarks/huey_app.py hands echo tasks to the huey Redis storage, which
  keeps results in the huey.results hash the cleanup already names.
- The consumer runs as one process with one thread, like the celery and
  dramatiq workers, and is stopped after a sentinel task proves the drain.
- The footnote lists huey with the queues that read one message at a time.
- The generated chart is left untouched; regenerate it with
  benchmarks/chart.py from a run on an idle machine.
Measured on an idle machine: threadmill 9,960 tasks/s, dramatiq 7,177,
huey 6,038, celery 2,280, django-tasks-db 2,065, django-tasks-rq 82. Four
of the five earlier rows land within 6% of the previous chart; threadmill
measured 9,960 against 11,977, which is the queue that coverage tracing
and start-cost quantization hit hardest.
@codingjoe
codingjoe merged commit 94eccf6 into main Oct 8, 2026
4 checks passed
@codingjoe
codingjoe deleted the codingjoe-add-huey-benchmarks branch October 8, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant