Commit graph

380 commits

Author SHA1 Message Date
Richard Artoul
d35aabfa86 remove double space 2018-12-07 16:11:16 -05:00
Richard Artoul
d6e2d07687 refactor comment for clarity 2018-12-07 16:11:16 -05:00
Richard Artoul
3193fc98ab refactor comment for clarity 2018-12-07 16:11:16 -05:00
Richard Artoul
3f3fec3824 refactor comment for clarity 2018-12-07 16:11:16 -05:00
Richard Artoul
efd6116d3f replace word in comment for clarity 2018-12-07 16:11:16 -05:00
Richard Artoul
038e3d4304 fix diagram 2018-12-07 16:11:16 -05:00
Richard Artoul
f97ff4b5a0 special case individual union 2018-12-07 16:11:16 -05:00
Richard Artoul
56b3d7d5db fix comment 2018-12-07 16:11:16 -05:00
Richard Artoul
feb19c62b9 Change repair functions to specify they are bitmap only 2018-12-07 16:11:16 -05:00
Richard Artoul
25eae0204d Update benchmarks 2018-12-07 16:11:16 -05:00
Richard Artoul
70338be7ca Add crazy comment 2018-12-07 16:11:16 -05:00
Richard Artoul
49df3fcd30 Dont shadow statshit 2018-12-07 16:11:16 -05:00
Richard Artoul
4cdf2adbe5 fix comment 2018-12-07 16:11:16 -05:00
Richard Artoul
06e7dbdc75 simplify and remove dead code 2018-12-07 16:11:16 -05:00
Richard Artoul
7931bc2c37 Add comment 2018-12-07 16:11:16 -05:00
Richard Artoul
defcb40f8c Add comment 2018-12-07 16:11:16 -05:00
Richard Artoul
c02479a5f9 more comments and cleanup 2018-12-07 16:11:16 -05:00
Richard Artoul
8e3da346c3 Add more comments and add helper method for bulk marking handled 2018-12-07 16:11:16 -05:00
Richard Artoul
5b50ecfd8e delete unused code 2018-12-07 16:11:16 -05:00
Richard Artoul
13dbe22b18 Move next logic into helper 2018-12-07 16:11:16 -05:00
Richard Artoul
fccc707006 remove debug code 2018-12-07 16:11:16 -05:00
Richard Artoul
d78e2fc87c Move repair logic to helpers 2018-12-07 16:11:16 -05:00
Richard Artoul
50f119df4e Allocate bitmap if needed (existing wrong type 2018-12-07 16:11:15 -05:00
Richard Artoul
3eb060c4c6 fix bug 2018-12-07 16:11:15 -05:00
Richard Artoul
eb5ad7bf49 dont keep n in sync with bitmaprun in place 2018-12-07 16:11:15 -05:00
Richard Artoul
b47292aa26 switch to bitmap repairs for inplace algo 2018-12-07 16:11:15 -05:00
Richard Artoul
339a78d88d wokring 2018-12-07 16:11:15 -05:00
Richard Artoul
e8e4369f76 all passing 2018-12-07 16:11:15 -05:00
Richard Artoul
30946a0372 working 2018-12-07 16:11:15 -05:00
Richard Artoul
af3cb91a40 first 2018-12-07 16:11:15 -05:00
Richard Artoul
2e1f60ac42 horrible wip 2018-12-07 16:11:15 -05:00
Richard Artoul
d2da91fdde add test 2018-12-07 16:11:15 -05:00
Richard Artoul
d3606e274d fix bug 2018-12-07 16:11:15 -05:00
Richard Artoul
b77c8a630b Add in place union 2018-12-07 16:11:15 -05:00
Seebs
e20671b2b4 silence gometalinter
I am aware that I don't actually ever use the length of a
after this line of code, but if I don't correctly update it,
any future change that needs that length will break
mysteriously. We humbly ask gometalinter to consider
the reply of counsel in _Arkell v. Pressdram_ (1971).
2018-11-16 15:00:09 -06:00
Seebs
7c82f48046 improve testing for intersections of array/array pairs
A transient bug introduced in intersectionCountArrayArray was
not caught by the tests, because it would only manifest when
two containers of different lengths were being compared. Also
improve the testing for intersectArrayArray, even though that
code hasn't been changed.
2018-11-16 15:00:09 -06:00
Seebs
1a8633f3a5 use roaring conventions for variable names
Roaring likes to call things "a" and "b", not "1" and "2",
and use "n" for length, not "l", etcetera. Adopt these
conventions to make code more readable.

Also drop the 'vb' value since it isn't expensive to
compute and the compiler can figure out that it can
reuse the value.
2018-11-16 15:00:09 -06:00
Seebs
9b552ab508 enhance TestRunCountRange
confirm that the number of runs comes out as expected,
and add a couple of numbers out of order to verify that
the 17-18-19 set gets coalesced into one run even
if we add 17 and 19 before 18.
2018-11-16 14:59:46 -06:00
Seebs
d4364bea52 slightly streamline array/array comparison
The net effect of this is to not recompute "the current
value of the first array" on every loop, pretty much.
However, the swap to make sure the inner loop is on the
longer array seems to be significant for performance.
On my system, this moves runtime from ~29us per op
to ~17us per op.
2018-11-16 14:59:46 -06:00
Seebs
32c4b3540f simplify intersectBitmapRun output to remove a conversion
If the total number of things returned was small enough to
make an array, intersectBitmapRun converted to an array. This
seems possibly-premature; future processing might well prefer
a bitmap. We know everything gets optimized before being
written out, let's not convert without a specific reason. But
also, let's use an array no matter which container is small
enough to prove that we can do so safely.

Fixes #854.
2018-11-16 14:59:09 -06:00
Seebs
c8e6fd2e43 improve type matrix for IntersectionCount benchmarks
The circumstances under which bitmaps are converted between
types are not 100% nailed down, and the IntersectionCount
benchmark was actually using a bitmap for the "run" data set
as well as for the "bitmap" data set. Fix that by using
Optimize() explicitly. Also, add a second RLE set so we
can compare the difference between "one run for the entire
set" and "several runs".

Also add array/array comparisons. We use two different
lengths of arrays, because performance turns out to vary
between "first array longer" and "second array longer".

Also added a benchmark for getBenchData itself, since it's
at least one possible use case for "creating a lot of
containers".
2018-11-16 14:59:09 -06:00
Seebs
8e270f9201 provide commented-out test case for bug in dead code
bitmapEquals isn't currently being called ever, but it has
an arcane edge-case bug, so I've made the test case for it
and commented it out for future reference.
2018-11-15 15:11:08 -06:00
Seebs
33add4f1e0 proof of concept for stats
This commit adds some trivial stat-tracking which can be
observed at localhost:10101/debug/vars. However, writes to
a locking data structure aren't cheap, so the stat-tracking
is by default not compiled. To build it, add the build
tag `roaringstats`, which will cause the `statsHit` function
to actually do something. Otherwise, it's an empty and
inlineable function, meaning the compiler throws it away
entirely.

This would, in principle, let us get additional visibility
into edge cases and which code paths are hot. This is not
the same thing as profiling for overall performance; the
stat counts aren't affected by whether a particular code path
is using a large amount of CPU time, just reporting how
often it happens at all.
2018-11-15 15:10:48 -06:00
Yuce Tekol
70f85211d9
prevent panic in Bitmap.UnmarshalBinary when there is no data 2018-11-15 22:06:21 +03:00
Todd Gruben
6aad568f28 added TODO(2.0) comment 2018-09-25 11:07:01 -05:00
Todd Gruben
be3bc105cd fixed upconvert;reverted to released interface 2018-09-25 10:40:04 -05:00
Todd Gruben
64e86614f8 shrank n(container bit count cache) to int32 2018-09-25 09:14:19 -05:00
Matt Jaffee
3ca7944fe3
remove unecessary lines
confirmed that bounds checks are still avoided by
go test -gcflags="-d=ssa/check_bce/debug=1"

./roaring.go:3387:8: Found IsSliceInBounds
./roaring.go:3388:8: Found IsSliceInBounds
./roaring.go:3436:21: Found IsSliceInBounds
2018-09-20 12:37:28 -05:00
tgruben
9b0cc07b30
Merge branch 'master' into bounds-check 2018-09-20 09:09:27 -05:00
Yuce Tekol
fcdc3b7427
trivial comment fix 2018-09-19 20:54:06 +03:00