mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix: improve performance of listpack sorted sets (#1885)
1. Cherry-pick changes from Redis 7 that encode integer scores more efficiently 2. Introduces optimization that first checks if the new element should be the last for listpack sorted sets. 3. Consolidates listpack related constants and tightens usage for listpack. 4. Introduce MEMORY USAGE command. 5. Introduce a small delay before decommitting memory pages back to OS. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
cfd83a66a2
commit
8d1474aeac
18 changed files with 124 additions and 279 deletions
|
@ -332,11 +332,11 @@ TEST_F(RdbTest, SaveManyDbs) {
|
|||
|
||||
TEST_F(RdbTest, HMapBugs) {
|
||||
// Force kEncodingStrMap2 encoding.
|
||||
server.hash_max_listpack_value = 0;
|
||||
server.max_map_field_len = 0;
|
||||
Run({"hset", "hmap1", "key1", "val", "key2", "val2"});
|
||||
Run({"hset", "hmap2", "key1", string(690557, 'a')});
|
||||
|
||||
server.hash_max_listpack_value = 32;
|
||||
server.max_map_field_len = 32;
|
||||
Run({"debug", "reload"});
|
||||
EXPECT_EQ(2, CheckedInt({"hlen", "hmap1"}));
|
||||
}
|
||||
|
@ -353,10 +353,10 @@ TEST_F(RdbTest, Issue1305) {
|
|||
*/
|
||||
|
||||
// Force kEncodingStrMap2 encoding.
|
||||
server.hash_max_listpack_value = 0;
|
||||
server.max_map_field_len = 0;
|
||||
Run({"hset", "hmap", "key1", "val", "key2", ""});
|
||||
|
||||
server.hash_max_listpack_value = 32;
|
||||
server.max_map_field_len = 32;
|
||||
Run({"debug", "reload"});
|
||||
EXPECT_EQ(2, CheckedInt({"hlen", "hmap"}));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue