You are here: Tuning > Main Operations Performance > Update Performance > Cient-Server

Client-Server

Client/server performance is a bit slower than local performance. This is illustrated with the following test:

UpdatePerformanceBenchmark.cs: RunClientServerTest
private void RunClientServerTest()
         {
            System.Console.WriteLine("Update test: Client/Server environment");
            int objectsToUpdate = 30;


            Init();
            Clean();
            Open(ConfigureClientServer());
            Store();
            System.Console.WriteLine("Update " + objectsToUpdate + " of " + 
_count + " objects locally:");
            UpdateItems(objectsToUpdate);
            Close();

            InitForClientServer();
            Clean();
            Open(ConfigureClientServer());
            Store();
            System.Console.WriteLine("Update " + objectsToUpdate + " of " + 
_count + " objects remotely:");
            UpdateItems(objectsToUpdate);
            Close();
        }
UpdatePerformanceBenchmark.cs: InitForClientServer
private void InitForClientServer()
         {
            _count = 1000;
            _depth = 90;
            _isClientServer = true;
            _host = "localhost";
        }
UpdatePerformanceBenchmark.cs: Init
private void Init()
         {
            _count = 1000;
            _depth = 90;
            _isClientServer = false;

        }
UpdatePerformanceBenchmark.cs: ConfigureClientServer
private IConfiguration ConfigureClientServer()
         {
            IConfiguration config = Db4oFactory.NewConfiguration();
            config.ClientServer().SingleThreadedClient(true);
            return config;
        }

The results:

Update test: Client/Server environment

Store 90000 objects: 7935ms

Update 30 of 1000 objects locally:

Updated 30 items: 404ms

Store 90000 objects: 11421ms

Update 30 of 1000 objects remotely:

Updated 30 items: 436ms

You can see that the performance drop is quite insignificant in this case, however it can be much worse on slow or unreliable networks.

Download example code:

c#