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.
2000 sequential `addJob` / `send` calls, each awaited.
20000 jobs through `addJobs` / `insert`, 1000 per call.
10000 pre-seeded jobs drained by a no-op handler, 100 fetched per claim and in flight; timed until every job is settled.
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/.