We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 10
1.21
latest
collection/zset
使用zset(skiplist)时,发现其remove,incr, updateScore比想象中的慢非常多。 初步看了下cpu开销,发现lessthan的比较函数执行次数远高于 incr, zrem的复杂度M*log(N)的次数量级。 比如添加1w个元素耗时lessthan执行次数:221038,更新这1w个元素要lessthan执行次数: 98797380 把测试数据增加到10w个,lessthan次数到:2748187, 等了很久都没等到10w个元素更新完成(手动停止了)
创建一个zset,
No response
The text was updated successfully, but these errors were encountered:
测试的分值,是0-10000的随机值
Sorry, something went wrong.
No branches or pull requests
Operating System
Windows 10
Go Version
1.21
Package Version
latest
Affected Packages
collection/zset
Expected Behavior
使用zset(skiplist)时,发现其remove,incr, updateScore比想象中的慢非常多。
初步看了下cpu开销,发现lessthan的比较函数执行次数远高于 incr, zrem的复杂度M*log(N)的次数量级。
比如添加1w个元素耗时lessthan执行次数:221038,更新这1w个元素要lessthan执行次数: 98797380
把测试数据增加到10w个,lessthan次数到:2748187, 等了很久都没等到10w个元素更新完成(手动停止了)
Actual Behavior
Reproduction Steps
创建一个zset,
Other Information
No response
The text was updated successfully, but these errors were encountered: