strings.Contains
standard libraryThe 45th most-called standard-library function by production calls. Called 78,184 times across 1,226 modules; 23,898 of those run outside tests and generated code.
1% in production calls vs 2026-W37 (23,618 → 23,898)
- prod calls
- 23,898
- non-test, non-generated
- all calls
- 78,184
- total callsites
- modules
- 1,226
- distinct callers
- in loop
- 26%
- of prod calls
- in tests
- 69%
- 53,688 calls
- resolved
- 100%
- to a known target
resolution mix
How each call resolves
How each call was attributed. Only resolved kinds, where the target function is known, count toward the ranking. Interface dispatch and unresolved receivers are reported separately and never guessed. Read the taxonomy →
- Package function100%A direct call to an exported package function, resolved by type.
estimate
Estimated relative cost
Roughly 0.01× the estimated relative cost of fmt.Sprintf . Benchmarked at 11.88 ns/op × 23,898 production calls, normalized so fmt.Sprintf = 1.0.
This is not dollars and not a verdict. Per-op time depends heavily on inputs (argument sizes, contention, patterns), the benchmark ran on a single machine (darwin/arm64 (Apple Silicon), go1.26.0), and static call counts are not runtime frequency. How this is estimated →
who calls this
Notable callers
Production calls into Contains from notable Go projects. Open one on the map to see what else it hammers.
- Kubernetes 2,547 11%
- Go (golang.org/x) 368 2%
- Istio 360 2%
- Docker 281 1%
- InfluxDB 233 <1%
where it's called
Callsites in the wild
12 representative callsites of 78,184, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
- in loop
- in loop
-
cdr.dev/slog @v1.6.1
internal/entryhuman/entry.go:152
in loop -
charm.land/catwalk @v0.52.48
cmd/pioneer/main.go:95
in loop -
charm.land/fantasy @v0.44.0
providers/anthropic/anthropic.go:90
in loop -
log/v2 @v2.0.1
text.go:249
in loop - in loop
- in loop
-
go/profiler @v0.6.0
proftest/proftest.go:188
in loop -
go/storage @v1.68.0
invoke.go:215
in loop -
cockroachdb/cockroach @v19.2.12+incompatible
in loop
top callers
The modules that reach for it
The modules that call Contains most in this snapshot.
- github.com/larksuite/cli6,8519%
- github.com/esengine/DeepSeek-Reasonix5,0286%
- github.com/gastownhall/beads2,7504%
- github.com/steveyegge/beads2,7504%
- github.com/infiniflow/ragflow2,3333%
siblings
More from strings
The other most-called functions in this package. See all →