(b *testing.B)
| 17 | ) |
| 18 | |
| 19 | func BenchmarkIndexMarshal(b *testing.B) { |
| 20 | b.Run("format=json", func(b *testing.B) { |
| 21 | for _, numBlocks := range []int{100, 1000, 10000} { |
| 22 | b.Run(fmt.Sprintf("blocks=%d", numBlocks), func(b *testing.B) { |
| 23 | dedicatedColumnsCache.Purge() |
| 24 | idx := makeTestTenantIndex(numBlocks) |
| 25 | for b.Loop() { |
| 26 | doNotOptimizeBytes, _ = idx.marshal() |
| 27 | } |
| 28 | }) |
| 29 | } |
| 30 | }) |
| 31 | |
| 32 | b.Run("format=proto", func(b *testing.B) { |
| 33 | for _, numBlocks := range []int{100, 1000, 10000} { |
| 34 | b.Run(fmt.Sprintf("blocks=%d", numBlocks), func(b *testing.B) { |
| 35 | dedicatedColumnsCache.Purge() |
| 36 | idx := makeTestTenantIndex(numBlocks) |
| 37 | for b.Loop() { |
| 38 | doNotOptimizeBytes, _ = idx.marshalPb() |
| 39 | } |
| 40 | }) |
| 41 | } |
| 42 | }) |
| 43 | } |
| 44 | |
| 45 | func BenchmarkIndexUnmarshal(b *testing.B) { |
| 46 | b.Run("format=json", func(b *testing.B) { |
nothing calls this directly
no test coverage detected