summaryrefslogtreecommitdiff
path: root/src/hyperloglog.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-14 16:15:55 +0200
committerantirez <antirez@gmail.com>2014-04-14 16:15:55 +0200
commit54f0156e8cbf1a58243d3a2b35f61311e1a034a4 (patch)
treeacba00687709c6ec7c8d29c96b511eca1985faa3 /src/hyperloglog.c
parent848d0461f9025fad994efec2e685c4c68fe625fe (diff)
downloadredis-54f0156e8cbf1a58243d3a2b35f61311e1a034a4.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.
Diffstat (limited to 'src/hyperloglog.c')
-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";