(b *testing.B)
| 801 | } |
| 802 | |
| 803 | func BenchmarkDeconstruct(b *testing.B) { |
| 804 | meta := backend.BlockMeta{ |
| 805 | DedicatedColumns: test.MakeDedicatedColumns(), |
| 806 | } |
| 807 | |
| 808 | batchCount := 100 |
| 809 | spanCounts := []int{ |
| 810 | 100, 1000, |
| 811 | 10000, |
| 812 | } |
| 813 | |
| 814 | poolSizes := []int{ |
| 815 | 100_000, |
| 816 | 30_000_000, |
| 817 | } |
| 818 | |
| 819 | for _, spanCount := range spanCounts { |
| 820 | for _, poolSize := range poolSizes { |
| 821 | ss := humanize.SI(float64(batchCount*spanCount), "") |
| 822 | ps := humanize.SI(float64(poolSize), "") |
| 823 | b.Run(fmt.Sprintf("SpanCount%v/Pool%v", ss, ps), func(b *testing.B) { |
| 824 | id := test.ValidTraceID(nil) |
| 825 | dbt := test.MakeTraceWithSpanCount(batchCount, spanCount, id) |
| 826 | test.AddDedicatedAttributes(dbt) |
| 827 | |
| 828 | tr, _ := traceToParquet(&meta, id, dbt, nil) |
| 829 | sch := parquet.SchemaOf(tr) |
| 830 | |
| 831 | b.ResetTimer() |
| 832 | |
| 833 | pool := newRowPool(poolSize) |
| 834 | |
| 835 | for i := 0; i < b.N; i++ { |
| 836 | r2 := sch.Deconstruct(pool.Get(), tr) |
| 837 | pool.Put(r2) |
| 838 | } |
| 839 | }) |
| 840 | } |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | func TestParquetRowSizeEstimate(t *testing.T) { |
| 845 | // use this test to parse actual Parquet files and compare the two methods of estimating row size |
nothing calls this directly
no test coverage detected