Redact vs Presidio

Same job. Same payload. 31.8x the speed.

Microsoft Presidio is the default answer for PII detection, and it's a good one — we were inspired by it and match its concepts deliberately. It's also Python, which puts a real cost in front of anyone who wants redaction in the request path rather than in a batch job.

Redact is a Rust reimplementation of that job. Below is the measurement, the method, and the parts where Presidio is still the better choice.

Measured 2026-04-18

The numbers.

MetricRedact (Rust)Presidio (Python)Difference
p50 Latency 0.1960 ms 6.2451 ms 31.8x
p99 Latency 1.8951 ms 21.6837 ms 11.4x
Avg Latency 0.2534 ms 7.1884 ms
Requests/sec 19,416 170 114.0x

Method

redact-api's /api/v1/analyze endpoint against mcr.microsoft.com/presidio-analyzer:latest. Both services in Docker on the same host. 500 requests, concurrency 1, Darwin arm64, measured with oha. Identical payload to both services.

Two honest caveats. At concurrency 1 the requests-per-second figure is a serialized round-trip rate rather than saturated throughput — a concurrency sweep is in progress and will replace it here. And this measures the analyzer, not the gateway: call-path overhead for redact-gateway is being measured separately and isn't claimed yet.

Raw output and the harness are in the repository under docs/benchmarks/results-20260418-175909.md and scripts/benchmark-comparison.sh. Run it yourself — that's why it's committed.

Coverage

What Redact detects.

Pattern-based

61

With checksum validation — Luhn, mod-11, IBAN — to suppress false positives.

Of which secrets

25

Provider keys, tokens, webhooks, private keys, connection strings. Presidio does not cover this class.

Contextual (NER)

4

Optional ONNX transformer models for person, organization, location, date-time.

Counts derived at build time from crates/redact-core/src/types/entity.rs.

Where Presidio still wins

Reasons not to switch.

Stay on Presidio if

  • You need language coverage beyond what our NER models provide
  • Your stack is Python and a library call beats a service hop
  • You depend on Presidio's image or structured-data redaction
  • You need the maturity of a Microsoft-maintained project

Look at Redact if

  • Redaction sits in a latency-sensitive request path
  • You need credential and API-key detection, not just PII
  • You want a single static binary or a WASM build
  • You want the engine embedded in-process rather than called over HTTP