MCPcopy Create free account
hub / github.com/buger/jsonparser / BenchmarkJsonParserMedium

Function BenchmarkJsonParserMedium

benchmark/benchmark_medium_payload_test.go:39–50  ·  view source on GitHub ↗

* github.com/buger/jsonparser */ Verifies: STK-REQ-001 MCDC STK-REQ-001: N/A Verifies: STK-REQ-003 MCDC STK-REQ-003: N/A Verifies: STK-REQ-004 MCDC STK-REQ-004: N/A Verifies: STK-REQ-005 MCDC STK-REQ-005: N/A Verifies: STK-REQ-007 MCDC STK-REQ-007: N/A reqproof:proptest:skip performance benchmark

(b *testing.B)

Source from the content-addressed store, hash-verified

37// MCDC STK-REQ-007: N/A
38// reqproof:proptest:skip performance benchmark; measures wall-clock time and allocations, output is non-deterministic and not comparable to an independent reference
39func BenchmarkJsonParserMedium(b *testing.B) {
40 for i := 0; i < b.N; i++ {
41 jsonparser.Get(mediumFixture, "person", "name", "fullName")
42 jsonparser.GetInt(mediumFixture, "person", "github", "followers")
43 jsonparser.Get(mediumFixture, "company")
44
45 jsonparser.ArrayEach(mediumFixture, func(value []byte, dataType jsonparser.ValueType, offset int, err error) {
46 jsonparser.Get(value, "url")
47 nothing()
48 }, "person", "gravatar", "avatars")
49 }
50}
51
52// Verifies: STK-REQ-001
53// MCDC STK-REQ-001: N/A

Callers

nothing calls this directly

Calls 4

GetFunction · 0.92
GetIntFunction · 0.92
ArrayEachFunction · 0.92
nothingFunction · 0.85

Tested by

no test coverage detected