MCPcopy Create free account
hub / github.com/cockroachdb/redact / BenchmarkRedactCall_RegularRedaction

Function BenchmarkRedactCall_RegularRedaction

bench_test.go:30–36  ·  view source on GitHub ↗

BenchmarkRedactCall_PlainMarkers calls .Redact() on a string with only regular ‹...› markers (no hash markers). This is the baseline.

(b *testing.B)

Source from the content-addressed store, hash-verified

28// BenchmarkRedactCall_PlainMarkers calls .Redact() on a string with only
29// regular ‹...› markers (no hash markers). This is the baseline.
30func BenchmarkRedactCall_RegularRedaction(b *testing.B) {
31 s := Sprintf("user=%s action=%s", "alice", Safe("login"))
32 b.ResetTimer()
33 for i := 0; i < b.N; i++ {
34 _ = s.Redact()
35 }
36}
37
38// BenchmarkRedactCall_HashMarkers calls .Redact() on a string with ‹†...›
39// hash markers and hashing enabled. This exercises the SHA-256 path.

Callers

nothing calls this directly

Calls 3

SprintfFunction · 0.70
SafeFunction · 0.70
RedactMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…