MCPcopy Index your code
hub / github.com/dunglas/httpsfv / BenchmarkParsingOfficialExamples

Function BenchmarkParsingOfficialExamples

httpwg_test.go:203–222  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

201}
202
203func BenchmarkParsingOfficialExamples(b *testing.B) {
204 file, _ := os.Open("structured-field-tests/examples.json")
205 dec := json.NewDecoder(file)
206
207 var tests []test
208 _ = dec.Decode(&tests)
209
210 for n := 0; n < b.N; n++ {
211 for _, te := range tests {
212 switch te.HeaderType {
213 case ITEM:
214 _, _ = UnmarshalItem(te.Raw)
215 case LIST:
216 _, _ = UnmarshalList(te.Raw)
217 case DICTIONARY:
218 _, _ = UnmarshalDictionary(te.Raw)
219 }
220 }
221 }
222}
223
224func BenchmarkSerializingOfficialExamples(b *testing.B) {
225 file, _ := os.Open("structured-field-tests/examples.json")

Callers

nothing calls this directly

Calls 3

UnmarshalItemFunction · 0.85
UnmarshalListFunction · 0.85
UnmarshalDictionaryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…