Skip to content

Commit

Permalink
Merge pull request #70 from glycerine/rle
Browse files Browse the repository at this point in the history
RunContainer32 implements a run-length
  • Loading branch information
lemire authored Dec 17, 2016
2 parents 19377e2 + 198ccf2 commit 1d61ef7
Show file tree
Hide file tree
Showing 39 changed files with 14,000 additions and 402 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: go
sudo: false
install:
- go get github.com/smartystreets/goconvey/convey
- go get github.com/willf/bitset
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
- go get github.com/mschoch/smat
- go get -t github.com/RoaringBitmap/roaring
- go get -t golang.org/x/tools/cmd/cover
- go get -t golang.org/x/tools/cmd/cover
- go get -t github.com/mattn/goveralls
- go get -t github.com/mschoch/smat
notifications:
email: false
go:
Expand All @@ -14,7 +14,7 @@ go:
- tip
script:
- go test -v -covermode=count -coverprofile=coverage.out
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken KOlKyOXz0qSjAqvfTF28RzNlr3unxjrLh
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken KOlKyOXz0qSjAqvfTF28RzNlr3unxjrLh -ignore arraycontainer_gen.go,bitmapcontainer_gen.go,rle16_gen.go,rle_gen.go,roaringarray_gen.go
matrix:
allow_failures:
- go: tip
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Elliot Murphy (@statik),
Bob Potter (@bpot),
Tyson Maly (@tvmaly),
Will Glynn (@willglynn),
Brent Pedersen (@brentp)
Brent Pedersen (@brentp),
Jason E. Aten (@glycerine)
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help all test format fmtcheck vet lint qa deps clean nuke
.PHONY: help all test format fmtcheck vet lint qa deps clean nuke rle backrle ser



Expand Down Expand Up @@ -80,3 +80,21 @@ clean:
nuke:
rm -rf ./target
GOPATH=$(GOPATH) go clean -i ./...

rle:
cp rle.go rle16.go
perl -pi -e 's/32/16/g' rle16.go
cp rle_test.go rle16_test.go
perl -pi -e 's/32/16/g' rle16_test.go

backrle:
cp rle16.go rle.go
perl -pi -e 's/16/32/g' rle.go
perl -pi -e 's/2032/2016/g' rle.go

ser: rle
go generate

cover:
go test -coverprofile=coverage.out
go tool cover -html=coverage.out
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ http://arxiv.org/abs/1402.6407 This paper used data from http://lemire.me/data/r
- Daniel Lemire, Gregory Ssi-Yan-Kai, Owen Kaser, Consistently faster and smaller compressed bitmaps with Roaring, Software: Practice and Experience (accepted in 2016, to appear) http://arxiv.org/abs/1603.06549



### Dependencies

- go get github.com/smartystreets/goconvey/convey
- go get github.com/willf/bitset
- go get github.com/mschoch/smat
Dependencies are fetched automatically by giving the `-t` flag to `go get`.

they include

- github.com/smartystreets/goconvey/convey
- github.com/willf/bitset
- github.com/mschoch/smat

Note that the smat library requires Go 1.6 or better.

Naturally, you also need to grab the roaring code itself:
- go get github.com/RoaringBitmap/roaring
#### Installation

- go get -t github.com/RoaringBitmap/roaring


### Example
Expand Down Expand Up @@ -130,13 +134,15 @@ bitmaps never use more than 2 bytes per integer. You can call

Current documentation is available at http://godoc.org/github.com/RoaringBitmap/roaring

### Thread-safety
### Goroutine safety

In general, it should generally be considered safe to access
the same bitmaps using different threads as
long as they are not being modified. However, if some of your
bitmaps use copy-on-write, then more care is needed: pass
to your threads a (shallow) copy of your bitmaps.
In general, it should not generally be considered safe to access
the same bitmaps using different goroutines--they are left
unsynchronized for performance. Should you want to access
a Bitmap from more than one goroutine, you should
provide synchronization. Typically this is done by using channels to pass
the *Bitmap around (in Go style; so there is only ever one owner),
or by using `sync.Mutex` to serialize operations on Bitmaps.

### Coverage

Expand Down Expand Up @@ -185,11 +191,7 @@ traces.

### Compatibility with Java RoaringBitmap library

You can read bitmaps in Go (resp. Java) that have been serialized in Java (resp. Go)
with the caveat that the Go library does not yet support run containers. So if you plan
to read bitmaps serialized from Java in Go, you might want to call ``removeRunCompression``
prior to serializing your Java instances. This is a temporary limitation: we plan to
add support for run containers to the Go library.
You can read bitmaps in Go (resp. Java) that have been serialized in Java (resp. Go).

### Alternative in Go

Expand Down
Loading

0 comments on commit 1d61ef7

Please sign in to comment.