Skip to content

#[pg_bench] — in-process benchmark harness (pgrx 0.18) for the perf tickets #77

Description

@styk-tv

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2deferred / contingentenhancementImprovement to existing behaviourtestTest infrastructure

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions