diff options
author | antirez <antirez@gmail.com> | 2017-09-28 18:12:15 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2017-11-04 17:39:27 +0100 |
commit | a9ecea51c9ef5350efdeb01abbb1e0aa8ae56d40 (patch) | |
tree | 8083fb298550f5a4a26eff63fea1e9637750b643 | |
parent | e0638635c48ef868bfb35a3439ad64623a8024d4 (diff) | |
download | redis-a9ecea51c9ef5350efdeb01abbb1e0aa8ae56d40.tar.gz |
Streams: reduce listpack max size to 2k to speedup range queries.
Listpack max size is a tradeoff between space and time. A 2k max entry
puts the memory usage approximately at a similar order of magnitude (5
million entries went from 96 to 120 MB), but the range queries speed
doubled (because there are half entries to scan in the average case).
Lower values could be considered, or maybe this parameter should be
made tunable.
-rw-r--r-- | src/t_stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_stream.c b/src/t_stream.c index 00d07ac57..956a9af1b 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -31,7 +31,7 @@ #include "endianconv.h" #include "stream.h" -#define STREAM_BYTES_PER_LISTPACK 4096 +#define STREAM_BYTES_PER_LISTPACK 2048 /* Every stream item inside the listpack, has a flags field that is used to * mark the entry as deleted, or having the same field as the "master" |