The problem/use-case that the feature addresses

The probability parameter ZSKIPLIST_P used in zslRandomLevel() is a result of trade-off between memory and query time. But furthermore, user would prefer a shorter response latency when the machine memory is sufficient, otherwise prefer less used memory.

Description of the feature

Provide an option to enable dynamic probability according to the number of elements in zset.

Alternatives you've considered

Shown in the table below, when the size of zset is smaller than a user-defined threshold (for example 10^7), set p = 1/e to reduce the query time by 5.79%; when the size of zset is larger than the threshold, set p = 1/6 to reduce the memory by 10%.

zset-p