I found something new: if you use another data type beside int for
message type, event in your PerfTests.cs PointToPointPerfTest, the
average speed will drop from 2 mil msg/s to around 320 000 msg/s as in
my application. Take a look at the code and try run it for a "string"
message type.
ActionExecutor executor = new ActionExecutor();
executor.BatchExecutor = new PerfExecutor();
executor.MaxDepth = 10000;
executor.MaxEnqueueWaitTime = 1000;
using (IFiber bus = new ThreadFiber(executor))
{
bus.Start();
IChannel<string> channel = new Channel<string>();
AutoResetEvent reset = new AutoResetEvent(false);
Action<string> onMsg = delegate(string msg)
{
if (msg == "finish")
{
reset.Set();
}
};
channel.Subscribe(bus, onMsg);
using (new PerfTimer(max))
{
for (int i = 0; i < max; i++)
{
channel.Publish("msg");
}
channel.Publish("finish");
reset.WaitOne(30000, false);