pgrx 0.18.0 shipped #[pg_bench] — the benchmarking counterpart to #[pg_test].
pgRDF uses it zero times. All our benchmarking is external to the extension.
What it gives us
Criterion-style benchmarks that run inside a live Postgres backend, with
direct SPI access and no round trip through psql:
- persistent history tables in a
pgrx_bench schema that survive extension
reinstalls, so runs compare across versions;
- git metadata +
pg_settings snapshots recorded per run;
- per-benchmark setup via
#[pg_bench(setup = ...)];
- transaction modes (
shared, subtransaction_per_batch,
subtransaction_per_iteration);
- Criterion's mixed-bootstrap T-test comparison model.
Run with cargo pgrx bench.
Why this matters to the roadmap
Several open tickets are performance bets with no in-repo instrument to settle
them:
Scope sketch
A benches module behind a feature gate, starting with the paths we already
argue about: dictionary intern rate, property-path expansion, staged-loader
phase timings.
Why P2, not P1
This is new capability, not foundation. It does not block the run and nothing
regresses without it.
Note on results discipline
Micro-benchmark numbers produced by this harness are pgRDF behaviour and are
disclosure-safe. Full-scale run results stay where they already go and do not
belong in this repo.
pgrx 0.18.0 shipped
#[pg_bench]— the benchmarking counterpart to#[pg_test].pgRDF uses it zero times. All our benchmarking is external to the extension.
What it gives us
Criterion-style benchmarks that run inside a live Postgres backend, with
direct SPI access and no round trip through
psql:pgrx_benchschema that survive extensionreinstalls, so runs compare across versions;
pg_settingssnapshots recorded per run;#[pg_bench(setup = ...)];shared,subtransaction_per_batch,subtransaction_per_iteration);Run with
cargo pgrx bench.Why this matters to the roadmap
Several open tickets are performance bets with no in-repo instrument to settle
them:
needs exactly a measurement record tied to a
pg_settingssnapshot. That iswhat
#[pg_bench]'s history tables are.claim without a benchmark regression guard.
Scope sketch
A
benchesmodule behind a feature gate, starting with the paths we alreadyargue about: dictionary intern rate, property-path expansion, staged-loader
phase timings.
Why P2, not P1
This is new capability, not foundation. It does not block the run and nothing
regresses without it.
Note on results discipline
Micro-benchmark numbers produced by this harness are pgRDF behaviour and are
disclosure-safe. Full-scale run results stay where they already go and do not
belong in this repo.