On Tue, 2005-04-05 at 12:18 +0200, Lluis Sanchez wrote:
> On my Pentium M 1600Mhz, I'm getting 1850 calls/seq with Mono 1.0.5,
> and 4050 calls/seq with Mono 1.1.5.

Now that sounds more like it.

I've just upgraded to 1.0.5 (the version currently in Debian Sid) on an
XP1600+, but I still only get ~12 calls per second with the attached
(very simple) code.
 Build and run with:
  mcs -t:library -out:thing.dll thing.cs
  mcs -r:thing.dll -r:System.Runtime.Remoting server.cs
  mcs -r:thing.dll -r:System.Runtime.Remoting client.cs
  xterm -e mono server.exe &
  time mono client.exe
to time 200 calls.
It takes ~16seconds realtime on my machine, but with only 0.467s user
and 0.037s system time it's basically sitting there mostly doing nothing
(top shows 99% idle)!

If you can't see anything wrong with the code (which is essentially
straight out of the OReilly "Programming C#" book) then I suspect
something bogus about the Debian setup.  The mono system itself seems to
be zippy enough: I can sum a billion ints in a couple of seconds.
For what it's worth, mono --profile on the client.exe shows most of the
16 seconds runtime is made up of 2800 calls at ~5.6ms each to
System.Net.Sockets.Socket::Receive_internal
Any ideas ?

Puzzled
Tim

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

public class Client
{
  static void Main(string[] args)
  {
    ChannelServices.RegisterChannel(new TcpChannel());
    MarshalByRefObject obj=(MarshalByRefObject)RemotingServices.Connect
      (
       typeof(Thing),
       "tcp://localhost:8080/thing"
      );
    Thing thing=obj as Thing;
    for (int i=0;i<200;i++) thing.Call();
  }
}

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

public class Server
{
  static void Main(string[] args)
  {
    ChannelServices.RegisterChannel(new TcpChannel(8080));

    Thing thing = new Thing();

    RemotingServices.Marshal(thing,"thing");

    while(true)
      {
	Console.Write('.');
	System.Threading.Thread.Sleep(1000);
      }
  }
}
using System;

public class Thing : MarshalByRefObject
{
  public Thing() {Console.WriteLine("Thing created");}
  public void Call() {Console.Write('!');}
}

Reply via email to