(b *testing.B)
| 17 | ) |
| 18 | |
| 19 | func 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 | |
| 43 | func createShardedMap(id uint64, val types.Val) *types.ShardedMap { |
| 44 | k := types.NewShardedMap() |
nothing calls this directly
no test coverage detected
searching dependent graphs…