MCPcopy Create free account
hub / github.com/google/gapid / BenchmarkDecode

Function BenchmarkDecode

gapil/bapi/bapi_test.go:144–158  ·  view source on GitHub ↗

Run the benchmarks with: bazel run //gapil/bapi:go_default_test -- -test.bench=. Times how long a decode takes.

(b *testing.B)

Source from the content-addressed store, hash-verified

142
143// Times how long a decode takes.
144func BenchmarkDecode(b *testing.B) {
145 ctx := log.Testing(b)
146
147 apis, mappings := resolveAPIs(ctx)
148
149 data, err := bapi.Encode(apis, mappings)
150 check(err)
151
152 b.ResetTimer()
153
154 for i := 0; i < b.N; i++ {
155 _, _, err := bapi.Decode(data)
156 check(err)
157 }
158}
159
160// Times how long each of the following takes:
161// * Parsing and resolving from source

Callers

nothing calls this directly

Calls 4

resolveAPIsFunction · 0.85
checkFunction · 0.70
EncodeMethod · 0.65
DecodeMethod · 0.65

Tested by

no test coverage detected