Skip to content

Commit e38f9c1

Browse files
Increase embedded string threshold from 64 to 128 bytes
1 parent 3c46f66 commit e38f9c1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/object.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static bool shouldEmbedStringObject(size_t val_len, const_sds key, long long exp
237237
}
238238
size += (expire != EXPIRY_NONE) * sizeof(long long);
239239
size += sdsReqSize(val_len, SDS_TYPE_8);
240-
return size <= 64;
240+
return size <= 128;
241241
}
242242

243243
/* Create a string object with EMBSTR encoding if it is small, otherwise RAW encoding */
@@ -274,7 +274,6 @@ void *objectGetVal(const robj *o) {
274274
data += 1 + hdr_size; /* +1 for header size byte */
275275
data += sdslen((const_sds)data) + 1; /* +1 for null terminator */
276276
}
277-
assert(o->encoding == OBJ_ENCODING_EMBSTR);
278277
return data + sdsHdrSize(SDS_TYPE_8);
279278
} else {
280279
return o->val_ptr;

0 commit comments

Comments
 (0)