github.com/parquet-go/parquet-go@v0.21.1-0.20240501160520-b3c3a0c3ed6f/internal/bytealg/bytealg_test.go (about)

     1  package bytealg_test
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  var benchmarkBufferSizes = [...]int{
     9  	4 * 1024,
    10  	256 * 1024,
    11  	2048 * 1024,
    12  }
    13  
    14  func forEachBenchmarkBufferSize(b *testing.B, f func(*testing.B, int)) {
    15  	for _, bufferSize := range benchmarkBufferSizes {
    16  		b.Run(fmt.Sprintf("%dKiB", bufferSize/1024), func(b *testing.B) {
    17  			b.SetBytes(int64(bufferSize))
    18  			f(b, bufferSize)
    19  		})
    20  	}
    21  }