summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-14 16:15:55 +0200
committerantirez <antirez@gmail.com>2014-04-16 15:26:27 +0200
commit05563310f4914563413ebb6bf4817ef37b7ebc92 (patch)
treeca3dec923ed61adbcf0e6e2ce19713ac3d74f21f
parente77a3e40f2d12b0e31c829c907330863f7912269 (diff)
downloadredis-05563310f4914563413ebb6bf4817ef37b7ebc92.tar.gz
Set HLL_SPARSE_MAX to 3000.
After running a few benchmarks, 3000 looks like a reasonable value to keep HLLs with a few thousand elements small while the CPU cost is still not huge. This covers all the cases where the dense representation would use N orders of magnitude more space, like in the case of many HLLs with carinality of a few tens or hundreds. It is not impossible that in the future this gets user configurable, however it is easy to pick an unreasoable value just looking at savings in the space dimension without checking what happens in the time dimension.
-rw-r--r--src/hyperloglog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index c4cb5674d..f5df8fc31 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -202,7 +202,7 @@ struct hllhdr {
#define HLL_SPARSE 1 /* Sparse encoding */
#define HLL_MAX_ENCODING 1
-#define HLL_SPARSE_MAX 12000
+#define HLL_SPARSE_MAX 3000
static char *invalid_hll_err = "Corrupted HLL object detected";