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

Function BenchmarkJsonParserLarge

benchmark/benchmark_large_payload_test.go:31–44  ·  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 reqproof:proptest:skip performance benchmark; measures wall-clock time and allocations, output is non-deterministic and not comparab

(b *testing.B)

Source from the content-addressed store, hash-verified

29// MCDC STK-REQ-004: N/A
30// reqproof:proptest:skip performance benchmark; measures wall-clock time and allocations, output is non-deterministic and not comparable to an independent reference
31func BenchmarkJsonParserLarge(b *testing.B) {
32 for i := 0; i < b.N; i++ {
33 jsonparser.ArrayEach(largeFixture, func(value []byte, dataType jsonparser.ValueType, offset int, err error) {
34 jsonparser.Get(value, "username")
35 nothing()
36 }, "users")
37
38 jsonparser.ArrayEach(largeFixture, func(value []byte, dataType jsonparser.ValueType, offset int, err error) {
39 jsonparser.GetInt(value, "id")
40 jsonparser.Get(value, "slug")
41 nothing()
42 }, "topics", "topics")
43 }
44}
45
46/*
47 encoding/json

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected