Skip to main content

Benchmarks

The benchmarks/ folder in the repository holds one head-to-head comparison per library. PortQueue runs there straight from the repository, not from the published package, so every run measures the latest code.

How it stays fair​

  • Every library in a comparison runs on the same machine, against the same database driver and version, from the same timing code with equal settings.
  • Every run starts in a fresh process on a clean, empty database. The charts show the median of several runs.
  • Each library is set up the way its own docs recommend for that database.

PortQueue vs pg-boss​

pg-boss is the most widely used PostgreSQL-backed job queue for Node.js. PortQueue runs on its own PGLite driver. pg-boss (v12) runs the way its own docs set it up for PGLite: backend: 'pglite' with its official fromPglite adapter.

Last run 2026-11-17 on Apple M1 Max (10 cores), darwin arm64, Node v24.21.0, PGLite 0.2.17. Median of 3 runs. Versions: PortQueue 1.2.1, pg-boss 12.38.2.

Adding jobs, one at a time (jobs/s, higher is better)
2,293.8
PortQueue (PGLite)1.2.1
1,140.8
pg-boss (PGLite)12.38.2

2000 sequential `addJob` / `send` calls, each awaited.

Adding jobs in batches (jobs/s, higher is better)
76,937.5
PortQueue (PGLite)1.2.1
41,951.5
pg-boss (PGLite)12.38.2

20000 jobs through `addJobs` / `insert`, 1000 per call.

Processing jobs (jobs/s, higher is better)
20,130.6
PortQueue (PGLite)1.2.1
17,441
pg-boss (PGLite)12.38.2

10000 pre-seeded jobs drained by a no-op handler, 100 fetched per claim and in flight; timed until every job is settled.

Pickup latency (p50) (ms, lower is better)
1.2
PortQueue (PGLite)1.2.1
2.3
pg-boss (PGLite)12.38.2

50 sequential jobs on an idle worker, timed from the add call to the handler starting.

Run it yourself​

From the repository root. The launcher builds @portqueue/core, runs every scenario and rewrites all of the charts: the comparison's README, this page and the summary chart on the README and homepage.

npm run benchmark:portqueue-vs-pgboss
npm run benchmark:portqueue-vs-pgboss -- latency # only the named scenario(s)

# or the shell script the npm script calls:
./scripts/benchmarks/portqueue_vs_pgboss.sh

Sizes are set through environment variables (BENCH_REPEATS, BENCH_PROCESS_JOBS, BENCH_CONCURRENCY, …). The full list is in the comparison's README. There is one launcher per comparison under scripts/benchmarks/.