From 8ac416848387f7062dcb019719d15fc875e9377b Mon Sep 17 00:00:00 2001 From: Andrzej Liszka Date: Thu, 24 Oct 2024 15:47:16 +0200 Subject: [PATCH] bench 10 --- bitmap_conc_test.go | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/bitmap_conc_test.go b/bitmap_conc_test.go index e300b63..dcbcda7 100644 --- a/bitmap_conc_test.go +++ b/bitmap_conc_test.go @@ -4,10 +4,10 @@ package sroar // var subsets []*Bitmap // func init() { -// // randSeed := int64(1724861525311) -// randSeed := time.Now().UnixNano() +// randSeed := int64(1724861525311) +// // randSeed := time.Now().UnixNano() // countSubsets := 10 -// countElements := 56 +// countElements := 1234567 // // max element is 3x bigger than capacity of single bm's container // maxX := (int(math.MaxUint16) + 1) * 3 @@ -55,19 +55,30 @@ package sroar // } // } -// // go test -v -bench Benchmark_And_Buf -benchmem -run ^$ github.com/weaviate/sroar -cpuprofile cpu.prof -// func Benchmark_And_Buf(b *testing.B) { +// // go test -v -bench Benchmark_And_Buf1 -benchmem -run ^$ github.com/weaviate/sroar -cpuprofile cpu.prof +// func Benchmark_And_Buf1(b *testing.B) { // for i := 0; i < b.N; i++ { // bm := superset.Clone() -// buf := make([]uint16, maxContainerSize) // for j, l := 0, len(subsets); j < l; j++ { +// buf := make([]uint16, maxContainerSize) // bm.AndBuf(subsets[j], buf) // } // } // } -// // go test -v -bench Benchmark_And_Buf -benchmem -run ^$ github.com/weaviate/sroar -cpuprofile cpu.prof +// // go test -v -bench Benchmark_And_Buf2 -benchmem -run ^$ github.com/weaviate/sroar -cpuprofile cpu.prof // func Benchmark_And_Buf2(b *testing.B) { +// for i := 0; i < b.N; i++ { +// bm := superset.Clone() +// buf := make([]uint16, maxContainerSize) +// for j, l := 0, len(subsets); j < l; j++ { +// bm.AndBuf(subsets[j], buf) +// } +// } +// } + +// // go test -v -bench Benchmark_And_Buf2 -benchmem -run ^$ github.com/weaviate/sroar -cpuprofile cpu.prof +// func Benchmark_And_Buf3(b *testing.B) { // buf := make([]uint16, maxContainerSize) // for i := 0; i < b.N; i++ { // bm := superset.Clone()