MCPcopy
hub / github.com/dgraph-io/dgraph / BenchmarkWordsMap

Function BenchmarkWordsMap

xidmap/trie_test.go:89–107  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

87}
88
89func BenchmarkWordsMap(b *testing.B) {
90 buf := make([]byte, 32)
91 m := make(map[string]uint64)
92 var uid uint64
93
94 for i := 0; i < b.N; i++ {
95 rand.Read(buf)
96 uid++
97 word := string(buf)
98 m[word] = uid
99 }
100
101 var count int
102 for word := range m {
103 _ = word
104 count++
105 }
106 b.Logf("Number of words added: %d\n", count)
107}

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected