clearspring/stream-lib — pull request #36 by cykl (2013-06-03 21:53:56+00:00)
Title: Faster hll card

According to my benchmarks the new implementation is 3 to 50 times faster depending on the set cardinality.

```
==> master.txt <==
Benchmark Thr Cnt Sec Mean Mean error Var Units
b.g.t.HLLCardinalityBenchmark.hllCardinalityEmpty 1 3 5 15457.128 47.659 69.176 ops/sec
b.g.t.HLLCardinalityBenchmark.hllCardinalityLarge 1 3 5 1362.456 8.625 2.266 ops/sec
b.g.t.HLLCardinalityBenchmark.hllCardinalityMedium 1 3 5 1817.350 8.034 1.966 ops/sec
b.g.t.HLLCardinalityBenchmark.hllCardinalitySmall 1 3 5 13523.778 40.515 49.991 ops/sec

==> faster_hll_card.txt <==
Benchmark Thr Cnt Sec Mean Mean error Var Units
b.g.t.HLLCardinalityBenchmark.hllCardinalityEmpty 1 3 5 48636.378 311.322 2951.758 ops/sec
b.g.t.HLLCardinalityBenchmark.hllCardinalityLarge 1 3 5 50545.389 621.955 11780.896 ops/sec
b.g.t.HLLCardinalityBenchmark.hllCardinalityMedium 1 3 5 50327.211 842.108 21597.134 ops/sec
b.g.t.HLLCardinalityBenchmark.hllCardinalitySmall 1 3 5 49598.833 345.749 3640.675 ops/sec

```

The cardinality method could be optimized further using the same approach than the one I have used for merge but I'm not sure it currently worth it. I have to profile real some world jobs before going further.