From a28141c4664dd77eeafc3e395b422e9551596804 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Mon, 11 Mar 2019 16:31:06 -0500 Subject: [PATCH] revert to Union for importRoaring UnionInPlace is still heavily affected by https://github.com/pilosa/pilosa/issues/1875 where containers that exist in an incoming bitmap can cause massive unnecessary allocations of bitmap containers when an array of short length is all that's needed. --- fragment.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fragment.go b/fragment.go index 0801c8001..32b870fb9 100644 --- a/fragment.go +++ b/fragment.go @@ -1763,11 +1763,8 @@ func (f *fragment) importRoaring(data []byte, clear bool) error { if clear { bm = f.storage.Difference(bm) - } else if f.storage.Containers.Size() >= bm.Containers.Size() { - f.storage.UnionInPlace(bm) - bm = f.storage - } else { - bm.UnionInPlace(f.storage) + } else if f.storage.Any() { + bm = f.storage.Union(bm) } for rowID := range rowSet {