GitHub user VIVALXH edited a comment on the discussion: 内存中的数据量是否会影响性能?

@git-hulk 谢谢,那时的内存下降可能是内存溢出docker重启了,这个表现确实和内存没关系。

在控制内存大小的情况下,我们简化了测试命令并重新测试,应该是lrange的时间复杂度问题。
再请问下,redis lrange是 O(S+N),但在 kvrocks 代码中,感觉 lrange 的时间复杂度应该是O(N)?start 
offset会影响吗?
![image](https://github.com/user-attachments/assets/a28fb5a9-4114-4713-874c-36b04b84d253)


测试命令:
redis-benchmark -h 192.168.1.115 -p 6666 -c 30 -n 10000000 eval '
  local key="key:" .. math.random(100000, 200000) 
  local value=string.rep("a", 512) 
  redis.call("lpush",key,value)
  return redis.call("lrange",key,0,10)
' 0

测试结果:
![image](https://github.com/user-attachments/assets/97da2c78-9834-4705-a05c-c976770d3db1)




GitHub link: 
https://github.com/apache/kvrocks/discussions/2695#discussioncomment-11625549

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to