mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 19:07:50 +00:00
wokring
This commit is contained in:
parent
e8e4369f76
commit
339a78d88d
2 changed files with 18 additions and 18 deletions
|
|
@ -407,9 +407,6 @@ func (b *Bitmap) Union(others ...*Bitmap) *Bitmap {
|
|||
// b in place.
|
||||
func (b *Bitmap) UnionInPlace(others ...*Bitmap) {
|
||||
b.unionIntoTarget(b, others...)
|
||||
// for _, other := range others {
|
||||
// b.unionIntoTarget(other, b)
|
||||
// }
|
||||
}
|
||||
|
||||
type wrapperIter struct {
|
||||
|
|
@ -504,12 +501,15 @@ func (b *Bitmap) unionIntoTarget(target *Bitmap, others ...*Bitmap) {
|
|||
// }
|
||||
// else {
|
||||
// Use a bitmap
|
||||
buf := make([]uint64, bitmapN)
|
||||
ob := buf[:bitmapN]
|
||||
container := &Container{
|
||||
bitmap: ob,
|
||||
n: 0,
|
||||
containerType: containerBitmap,
|
||||
container := target.Containers.Get(iKey)
|
||||
if container == nil {
|
||||
buf := make([]uint64, bitmapN)
|
||||
ob := buf[:bitmapN]
|
||||
container = &Container{
|
||||
bitmap: ob,
|
||||
n: 0,
|
||||
containerType: containerBitmap,
|
||||
}
|
||||
}
|
||||
|
||||
for _, jIter := range otherIters {
|
||||
|
|
|
|||
|
|
@ -1424,12 +1424,12 @@ func BenchmarkUnion(b *testing.B) {
|
|||
}
|
||||
}
|
||||
|
||||
// func BenchmarkUnionBulk(b *testing.B) {
|
||||
// // a1, a2, b, r1, r2 *roaring.Bitmap
|
||||
// data := getBenchData(b)
|
||||
// yolo := roaring.NewBitmap()
|
||||
// for n := 0; n < b.N; n++ {
|
||||
// yolo.
|
||||
// BulkUnion(data.a1, data.a2, data.b, data.r1, data.r2)
|
||||
// }
|
||||
// }
|
||||
func BenchmarkUnionBulk(b *testing.B) {
|
||||
// a1, a2, b, r1, r2 *roaring.Bitmap
|
||||
data := getBenchData(b)
|
||||
yolo := roaring.NewBitmap()
|
||||
for n := 0; n < b.N; n++ {
|
||||
yolo.
|
||||
UnionInPlace(data.a1, data.a2, data.b, data.r1, data.r2)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue