Hushfang / Guide
Registry latency
2026-12-06 UTC · Apple M1 Max · macOS-27.2.1-arm64-arm-64bit-Mach-O · Python 3.14.10 · Hushfang 0.2.0 (matcher adee25594302) · Pydantic 2.14.4 · 66-byte input · 31 paired samples per path and size.
From 0.1.0 to 0.2.0
At one million registered values, a clean 66-byte log line went from 1.47 seconds of added median formatter time to about 14 microseconds. A one-match line went from 1.41 seconds to about 15 microseconds. At one value the median is about 3–4 microseconds in both versions. The million-value batch still took 12.43 seconds to register and the process peaked at 1,536.6 MiB.
Hushfang 0.2.0 looks up candidate substrings in its set of known spellings when the record and registered lengths make this economical. For smaller registries or long substrings it uses native string search. These are warm measurements of repeated short text records under the exact policy. Binary redaction, varied record lengths, named fields, loading rate and concurrent traffic have different costs.
| Registered values | Clean added p50, 0.1.0 | Clean added p50, 0.2.0 | One match added p50, 0.1.0 | One match added p50, 0.2.0 |
|---|---|---|---|---|
| 1 | 2.92 µs | 3.04 µs | 3.33 µs | 3.58 µs |
| 10 | 7.25 µs | 7.17 µs | 6.71 µs | 6.75 µs |
| 100 | 54.08 µs | 53.00 µs | 47.08 µs | 45.29 µs |
| 1,000 | 544.79 µs | 13.96 µs | 506.58 µs | 14.17 µs |
| 10,000 | 7.97 ms | 13.50 µs | 7.53 ms | 14.12 µs |
| 100,000 | 141.81 ms | 12.79 µs | 138.18 ms | 13.17 µs |
| 1,000,000 | 1.47 s | 13.96 µs | 1.41 s | 14.58 µs |
Both runs used the same Apple M1 Max, Python version, sample counts, synthetic values and record shapes. Registration ran once per size. The percentile estimates describe these runs. 0.1.0 data · 0.2.0 data
Measurement method
Each row comes from a fresh process with the default exact registry. A single register(*values) call receives distinct synthetic 32-character ASCII SecretStr tokens. Setup time covers registration, including preparation of encoded forms. Peak RSS is the worker's process high-water mark, including input objects and temporary allocations. Linux and macOS report RSS in this experiment.
The clean line and the line containing one exact token have equal input length. Each path first checks the complete output and warms both formatters. Each subsequent sample times one format(record) call on a prebuilt record. Stdlib and Hushfang alternate first position in each pair. Added p50 is the median of the paired differences. P95 is the nearest-rank percentile of individual Hushfang calls. These measurements exclude logger dispatch, I/O, queueing, contention and field-name rules.
Per log record
| Secrets | Input | Stdlib p50 | Hushfang p50 | Added p50 | Hushfang p95 |
|---|---|---|---|---|---|
| 1 | Clean | 0.58 µs | 3.67 µs | 3.04 µs | 7.54 µs |
| 1 | One match | 0.58 µs | 4.12 µs | 3.58 µs | 18.96 µs |
| 10 | Clean | 0.58 µs | 7.75 µs | 7.17 µs | 11.33 µs |
| 10 | One match | 0.58 µs | 7.29 µs | 6.75 µs | 8.29 µs |
| 100 | Clean | 0.67 µs | 53.67 µs | 53.00 µs | 58.96 µs |
| 100 | One match | 0.62 µs | 45.92 µs | 45.29 µs | 48.17 µs |
| 1,000 | Clean | 0.58 µs | 14.54 µs | 13.96 µs | 18.75 µs |
| 1,000 | One match | 0.58 µs | 14.79 µs | 14.17 µs | 17.79 µs |
| 10,000 | Clean | 0.62 µs | 14.12 µs | 13.50 µs | 19.67 µs |
| 10,000 | One match | 0.58 µs | 14.75 µs | 14.12 µs | 16.17 µs |
| 100,000 | Clean | 0.58 µs | 13.38 µs | 12.79 µs | 17.58 µs |
| 100,000 | One match | 0.54 µs | 13.71 µs | 13.17 µs | 15.62 µs |
| 1,000,000 | Clean | 0.62 µs | 14.62 µs | 13.96 µs | 18.79 µs |
| 1,000,000 | One match | 0.62 µs | 15.21 µs | 14.58 µs | 18.29 µs |
Registry preparation
| Secrets | Register batch | Peak process RSS (MiB) |
|---|---|---|
| 1 | 118.58 µs | 39.6 |
| 10 | 224.17 µs | 39.8 |
| 100 | 1.16 ms | 39.6 |
| 1,000 | 10.81 ms | 40.7 |
| 10,000 | 111.88 ms | 53.7 |
| 100,000 | 1.17 s | 189.3 |
| 1,000,000 | 12.43 s | 1,536.6 |
Reproduce the full sweep with task bench:latency. For a quick run use task bench:latency -- --sizes 1 1000.
Hushfang