go-ceph/internal/cutil/sync_buffer_test.go
Sven Anderson 1c719b199e tests: add benchmarks for PtrGuard related types
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-06-01 09:19:59 +00:00

15 lines
236 B
Go

package cutil
import "testing"
func BenchmarkSyncBuffer(b *testing.B) {
data := make([]byte, 1024*64)
var p = Malloc(PtrSize)
defer Free(p)
for i := 0; i < b.N; i++ {
sb := NewSyncBuffer(p, data)
sb.Sync()
sb.Release()
}
}