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

Function BenchmarkSet

issues_56_107_229_test.go:205–217  ·  view source on GitHub ↗

BenchmarkSet models Set's former incrementally-grown bytes.Buffer. Verifies: SYS-REQ-009 (Set)

(b *testing.B)

Source from the content-addressed store, hash-verified

203//
204// Verifies: SYS-REQ-009 (Set)
205func BenchmarkSet(b *testing.B) {
206 keys := make([]string, 100)
207 for i := range keys {
208 keys[i] = "key" + strconv.Itoa(i)
209 }
210 setValue := bytes.Repeat([]byte("value"), 100)
211
212 b.ReportAllocs()
213 b.ResetTimer()
214 for i := 0; i < b.N; i++ {
215 benchmarkSetInsertResult = createInsertComponentBuffered(keys, setValue, false, true)
216 }
217}
218
219// BenchmarkSetPreAllocated measures Set's calcAllocateSpace-backed component
220// construction.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected