bench_pg_unwind
Benchmark PostgreSQL/Rust exception unwinding overhead
bench_pg_unwind · Benchmark PostgreSQL/Rust exception unwinding overhead
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100564 | bench_pg_unwind | bench_pg_unwind | 0.1 | FEAT | Apache-2.0 | Rust |
Usage
Sources:
bench_pg_unwind 0.1 is a narrow 2020 microbenchmark for comparing repeated Rust-to-C calls with and without a PostgreSQL error-unwind guard. It is diagnostic code, not an application extension.
Disposable benchmark
Use small, positive iteration counts on an isolated server:
Both functions return the repeated addition result. Each call also emits a WARNING containing total and per-iteration timing, so collect server and client messages as the benchmark output.
Caveats
- The iteration count directly controls a tight backend CPU loop and has no upper bound. Never expose it to untrusted input.
- Zero or negative iterations make the timing code divide a duration by a nonpositive value and can enter a Rust panic path.
- Addition occurs in signed 64-bit C arithmetic without overflow checks. Choose start, increment, and iteration values whose result remains in range.
- Results include SQL-call, logging, clock, compiler, and build effects; they are not a general measure of PostgreSQL or Rust performance.
- The build depends on a historical Timescale Rust support branch and 2020-era PostgreSQL headers. Upstream provides no tests, compatibility matrix, README, or complete repository license files.