MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / BenchmarkProcessBinaryLargeMap

Function BenchmarkProcessBinaryLargeMap

query/math_test.go:19–41  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

17)
18
19func BenchmarkProcessBinaryLargeMap(b *testing.B) {
20 shardMap1 := types.NewShardedMap()
21 shardMap2 := types.NewShardedMap()
22
23 for i := 0; i < 10000000; i++ {
24 shardMap1.Set(uint64(i), types.Val{Tid: types.IntID, Value: int64(i)})
25 shardMap2.Set(uint64(i), types.Val{Tid: types.IntID, Value: int64(i)})
26 }
27
28 tree := &mathTree{
29 Fn: "+",
30 Child: []*mathTree{
31 {Var: "v1", Val: shardMap1},
32 {Var: "v2", Val: shardMap2},
33 },
34 }
35
36 b.Run("ProcessBinary", func(b *testing.B) {
37 for i := 0; i < b.N; i++ {
38 processBinary(tree)
39 }
40 })
41}
42
43func createShardedMap(id uint64, val types.Val) *types.ShardedMap {
44 k := types.NewShardedMap()

Callers

nothing calls this directly

Calls 4

SetMethod · 0.95
NewShardedMapFunction · 0.92
processBinaryFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…