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

Function BenchmarkDjsonLarge

benchmark/benchmark_large_payload_test.go:158–172  ·  view source on GitHub ↗

* github.com/a8m/djson */ 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 comparable to a

(b *testing.B)

Source from the content-addressed store, hash-verified

156// MCDC STK-REQ-004: N/A
157// reqproof:proptest:skip performance benchmark; measures wall-clock time and allocations, output is non-deterministic and not comparable to an independent reference
158func BenchmarkDjsonLarge(b *testing.B) {
159 for i := 0; i < b.N; i++ {
160 m, _ := djson.DecodeObject(largeFixture)
161 users := m["users"].([]interface{})
162 for _, u := range users {
163 nothing(u.(map[string]interface{})["username"].(string))
164 }
165
166 topics := m["topics"].(map[string]interface{})["topics"].([]interface{})
167 for _, t := range topics {
168 tI := t.(map[string]interface{})
169 nothing(tI["id"].(float64), tI["slug"].(string))
170 }
171 }
172}

Callers

nothing calls this directly

Calls 1

nothingFunction · 0.85

Tested by

no test coverage detected