math/rand.Intn
standard libraryThe 544th most-called standard-library function by production calls. Called 3,987 times across 464 modules; 1,400 of those run outside tests and generated code.
- prod calls
- 1,400
- non-test, non-generated
- all calls
- 3,987
- total callsites
- modules
- 464
- distinct callers
- in loop
- 36%
- of prod calls
- in tests
- 65%
- 2,585 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.00× the estimated relative cost of fmt.Sprintf . Benchmarked at 7.55 ns/op × 1,400 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 Intn from notable Go projects. Open one on the map to see what else it hammers.
- Kubernetes 57 4%
- Dgraph 42 3%
- CockroachDB 28 2%
- Docker 16 1%
- Grafana 15 1%
where it's called
Callsites in the wild
12 representative callsites of 3,987, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
-
cilium/fake @v0.7.0
in loop - in loop
-
cockroachdb/cockroach @v19.2.12+incompatible
in loop - in loop
-
docker/docker @v28.5.2+incompatible
in loop -
encr.dev @v1.57.13
cli/daemon/redis/redis.go:91
in loop -
etcd-io/etcd @v2.3.8+incompatible
in loop -
DNSCrypt/dnscrypt-proxy @v0.0.0-20260801091651-c3ba78fac8a3
in loop -
GoesToEleven/GolangTraining @v0.0.0-20230828175525-f9a4f6cf3939
22_go-routines/13_channels_fan-out_fan-in/01_boring/main.go:22 ↗
in loop -
GoogleCloudPlatform/terraformer @v0.0.0-20260316201050-1807affdde9e
in loop - in loop
top callers
The modules that reach for it
The modules that call Intn most in this snapshot.
- github.com/cadence-workflow/cadence2306%
- github.com/uber/cadence2306%
- github.com/ethereum/go-ethereum1564%
- github.com/nats-io/nats-server/v21494%
- github.com/milvus-io/milvus/client/v21273%
siblings
More from math/rand
The other most-called functions in this package. See all →