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

Function BenchmarkUjsonMedium

benchmark/benchmark_medium_payload_test.go:410–427  ·  view source on GitHub ↗

* github.com/mreiferson/go-ujson */ 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 benchm

(b *testing.B)

Source from the content-addressed store, hash-verified

408// MCDC STK-REQ-007: N/A
409// reqproof:proptest:skip performance benchmark; measures wall-clock time and allocations, output is non-deterministic and not comparable to an independent reference
410func BenchmarkUjsonMedium(b *testing.B) {
411 for i := 0; i < b.N; i++ {
412 json, _ := ujson.NewFromBytes(mediumFixture)
413
414 person := json.Get("person")
415
416 person.Get("name").Get("fullName").String()
417 person.Get("github").Get("followers").Float64()
418 json.Get("company").String()
419
420 arr := person.Get("gravatar").Get("avatars").Array()
421 for _, el := range arr {
422 el.Get("url").String()
423 }
424
425 nothing()
426 }
427}
428
429/*
430 github.com/a8m/djson

Callers

nothing calls this directly

Calls 3

nothingFunction · 0.85
GetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected