Commit 0c00fd78 authored by antirez's avatar antirez
Browse files

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.
parent f24d3a7d
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "endianconv.h" #include "endianconv.h"
#include "stream.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 /* 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" * mark the entry as deleted, or having the same field as the "master"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment