

















bthulu · 2024 年 1 月 2 日 · 5320 次点击
这是一个创建于 875 天前的主题,其中的信息可能已经有所发展或是发生改变。
我一直用这个来生成多个表公用的自增 id. 今天闲来无聊测了下, tps=10, 这有点低的离谱啊 测试代码
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
Stopwatch stopwatch = Stopwatch.StartNew();
var count = 100000;
for (int i = 0; i < count; i++)
{
var id = (int)redis.GetDatabase().StringIncrement("PMDCS:id_hello");
}
stopwatch.Stop();
Console.WriteLine("用时:" + stopwatch.ElapsedMilliseconds + ", tps=" + (count / stopwatch.ElapsedMilliseconds));
测试结果 用时:8357, tps=11
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。