Commit 4a8da46d authored by Marc Gravell's avatar Marc Gravell

tweaks

parent 16363206
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using StackExchange.Redis;
......@@ -11,7 +12,13 @@ internal static class Program
{
private static void Main()
{
RunCompetingBatchesOnSameMuxer();
Console.WriteLine($"{Environment.OSVersion} / {Environment.Version} / {(Environment.Is64BitProcess ? "64" : "32")}");
Console.WriteLine(RuntimeInformation.FrameworkDescription);
for (int i = 0; i < 500; i++)
{
Console.WriteLine(i);
RunCompetingBatchesOnSameMuxer();
}
}
static ConnectionMultiplexer Create()
{
......@@ -19,7 +26,7 @@ static ConnectionMultiplexer Create()
muxer.GetDatabase().Ping();
return muxer;
}
private const int IterationCount = 5000, InnerCount = 20;
private const int IterationCount = 500, InnerCount = 20;
public static void RunCompetingBatchesOnSameMuxer()
{
using (var muxer = Create())
......@@ -60,6 +67,7 @@ private static void BatchRunIntegers(IDatabase db)
}
batch.Execute();
db.Multiplexer.WaitAll(tasks);
if (i % 1000 == 0) Console.WriteLine(i);
}
var count = (long)db.StringGet(key);
......@@ -78,6 +86,7 @@ private static void BatchRunPings(IDatabase db)
}
batch.Execute();
db.Multiplexer.WaitAll(tasks);
if (i % 1000 == 0) Console.WriteLine(i);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment