mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
Use FlatSet for Redis SETS
Add FlatSet data structure. Use FlatSet and get rid of t_set functions. Fix Hash bug. Add memory comparison test
This commit is contained in:
parent
a58ed46f1e
commit
c94d109cff
9 changed files with 524 additions and 133 deletions
|
@ -11,11 +11,15 @@ import time
|
|||
def fill_set(args, redis: rclient.Redis):
|
||||
for j in range(args.num):
|
||||
token = uuid.uuid1().hex
|
||||
# print(token)
|
||||
key = f'USER_OTP:{token}'
|
||||
otp = ''.join(random.choices(
|
||||
string.ascii_uppercase + string.digits, k=7))
|
||||
redis.execute_command('sadd', key, otp)
|
||||
|
||||
arr = []
|
||||
for i in range(30):
|
||||
otp = ''.join(random.choices(
|
||||
string.ascii_uppercase + string.digits, k=12))
|
||||
arr.append(otp)
|
||||
redis.execute_command('sadd', key, *arr)
|
||||
|
||||
def fill_hset(args, redis):
|
||||
for j in range(args.num):
|
||||
token = uuid.uuid1().hex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue