Package sdc implements simple dense coding which compresses an array of integers and allows random access in constant time.
The algorithm is taken from Simple dense coding described in Simple Random Access Compression by Kimmo Fredriksson and Fedor Nikitin. It uses an auxiliary structure to support fast select operations from Fast, Small, Simple Rank/Select on Bitmaps.
go get github.com/robskie/sdc
Godoc documentation can be found here.
These benchmarks are done on a Core i5 at 2.3GHz. You can run these benchmarks
by typing go test github.com/robskie/sdc -bench=.*
from terminal.
BenchmarkAdd-4 20000000 87.5 ns/op
BenchmarkGet-4 5000000 264 ns/op