(b *testing.B)
| 103 | } |
| 104 | |
| 105 | func BenchmarkSyncMap(b *testing.B) { |
| 106 | sm := NewSyncMap(100) |
| 107 | b.Run("Add", func(b *testing.B) { |
| 108 | for i := 0; i < b.N; i++ { |
| 109 | sm.Set(fmt.Sprintf("%d", i), i) |
| 110 | } |
| 111 | }) |
| 112 | b.Run("Get", func(b *testing.B) { |
| 113 | for i := 0; i < b.N; i++ { |
| 114 | sm.Get(fmt.Sprintf("%d", i)) |
| 115 | } |
| 116 | }) |
| 117 | b.Run("Delete", func(b *testing.B) { |
| 118 | for i := 0; i < b.N; i++ { |
| 119 | sm.Delete(fmt.Sprintf("%d", i)) |
| 120 | } |
| 121 | }) |
| 122 | } |
nothing calls this directly
no test coverage detected