Run the benchmarks with: bazel run //gapil/bapi:go_default_test -- -test.bench=. Times how long a decode takes.
(b *testing.B)
| 142 | |
| 143 | // Times how long a decode takes. |
| 144 | func 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 |
nothing calls this directly
no test coverage detected