[Mono-devel-list] Remoting speedup using buffered streams

Michel Dagenais michel.dagenais at polymtl.ca
Sun Nov 30 00:11:14 EST 2003


I used Mono and Remoting this year as assignments for a Distributed
Systems course and was disappointed with the Remoting performance as
compared to other systems used in the past (e.g., CORBA). I tried to
figure out why I was getting only 10 simple remote calls per second
(client and server on the same machine mono 0.28, method without
argument returning a 4 byte string). I finally realized that a large
part of the communication for each call was done one byte at a time
(Send/Receive on the socket).

I then tried a very simple modification, inserting a BufferedStream
around the GetStream in Tcp Channels:

./System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs:                   _stream = new BufferedStream(client.GetStream());
./System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs:                    _stream = new BufferedStream(_client.GetStream());

I now get about 1000 calls per second, a 100x speedup. I realize that
mono is still not in the performance tuning phase. However, this may be
of interest. Are there reasons for not using buffered streams that I
don't see?




More information about the Mono-devel-list mailing list