Skip to content
callcount

fmt.Sprintf

standard library

The 2nd most-called standard-library function by production calls. Called 9,820 times across 194 modules; 7,511 of those run outside tests and generated code.

2% in production calls vs 2026-06-sample (7,688 → 7,511)

All of fmt → Docs on pkg.go.dev ↗

prod calls
7,511
non-test, non-generated
all calls
9,820
total callsites
modules
194
distinct callers
in loop
11%
of prod calls
in tests
21%
2,048 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

Experimental

Estimated relative cost

This function is the reference point: 1.0×. Every other function’s estimated cost is expressed relative to it.

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, go1.22.5), and static call counts are not runtime frequency. How this is estimated →

who calls this

Notable callers

Production calls into Sprintf from notable Go projects. Open one on the map to see what else it hammers.

where it's called

Callsites in the wild

6 representative callsites of 9,820, prioritizing in-loop and non-test usage. We link to source, never display it.

Sprintf · 6 of 9,820 callsites

top callers

The modules that reach for it

The modules that call Sprintf most in this snapshot.

  • github.com/gorilla/mux2,94730%
  • github.com/hashicorp/consul2,14222%
  • github.com/stretchr/testify1,76118%

siblings

More from fmt

The other most-called functions in this package. See all →