Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 1 min read

WJb vs Hangfire vs Quartz: Same Benchmarks, Same Machine

WJb vs Hangfire vs Quartz: Same Benchmarks, Same Machine Background job libraries are usually compared by features. This benchmark compares something simpler: How fast can they enqueue work? Repository: https://git

WJb vs Hangfire vs Quartz: Same Benchmarks, Same Machine

WJb vs Hangfire vs Quartz: Same Benchmarks, Same Machine

Background job libraries are usually compared by features.

This benchmark compares something simpler:

How fast can they enqueue work?

Repository:

https://github.com/UkrGuru/WJb.Demo/tree/main/benchmark

WJb Benchmarks

Benchmarks were implemented separately for:

  • WJb
  • Hangfire
  • Quartz

Using:

  • BenchmarkDotNet
  • In-memory storage
  • No-op jobs/actions
  • Equivalent benchmark scenarios

Single Enqueue

Enqueue one job.

Library Time Memory
WJb 349 ns 328 B
Quartz 3.848 ΞΌs 3.08 KB
Hangfire 6.212 ΞΌs 11.46 KB

Result

  • WJb β‰ˆ 11Γ— faster than Quartz
  • WJb β‰ˆ 18Γ— faster than Hangfire

EnqueueMany (100,000 Jobs)

Bulk enqueue benchmark.

Library Time Memory
WJb 32 ms 31 MB
Hangfire 743 ms 1063 MB
Quartz 902 ms 539 MB

Result

  • WJb β‰ˆ 23Γ— faster than Hangfire
  • WJb β‰ˆ 28Γ— faster than Quartz

Parallel Enqueue (100,000 Jobs)

Multiple concurrent producers.

Library Best Time
WJb 52 ms
Hangfire 540 ms
Quartz 600 ms

Memory Usage

100,000 jobs:

Library Memory
WJb 31 MB
Quartz 539 MB
Hangfire 1063 MB

Result

  • WJb uses ~17Γ— less memory than Quartz
  • WJb uses ~34Γ— less memory than Hangfire

Why WJb?

WJb was designed around a very small execution model:

enqueue
  ↓
job
  ↓
action

No dashboard.

No workflow engine.

No implicit pipeline.

Just explicit background jobs.

Reproduce

Source code is included:

WJb.Benchmarks
WJb.Benchmarks.Hangfire
WJb.Benchmarks.Quartz

Run:

dotnet run -c Release

Final Numbers

For these benchmark scenarios:

βœ… Fastest enqueue: WJb

βœ… Fastest bulk enqueue: WJb

βœ… Fastest parallel enqueue: WJb

βœ… Lowest memory usage: WJb

Benchmark scenarios are intentionally small, reproducible, and focused on enqueue performance.
Additional scenarios will be added only when equivalent implementations exist for all compared libraries.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.