Not sure what I’m doing wrong, but the performance of the .net SDK has reduced significantly… Using .net SDK 2.7.x was incredibly faster… I simplified the test to just this…
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace CouchbaseTest
{
class Program
{
static async Task Main(string args)
{
var stopWatch = Stopwatch.StartNew();
var cluster = await Couchbase.Cluster.ConnectAsync(“ip address”, “user”, “pwd”).ConfigureAwait(false);
var bucket = await cluster.BucketAsync(“bucketname”).ConfigureAwait(false);
var ping = bucket.PingAsync().ConfigureAwait(false);
stopWatch.Stop();
Console.WriteLine($"{stopWatch.ElapsedMilliseconds} ms");
}
}
}
The code works (with proper ip address, username and password) and returns in about 36 seconds (testing against remote server) with 3.x sdk. With 2.7 sdk it returns in about 3 seconds… using the following code:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Couchbase;
using Couchbase.Configuration.Client;
namespace CouchbaseTest
{
class Program
{
static void Main(string args)
{
var clientConfig = new ClientConfiguration
{
Servers = new List { new Uri(“http://ip address:8091”) }
};
var stopWatch = Stopwatch.StartNew();
var cluster = new Cluster(clientConfig);
cluster.Authenticate("user", "pswd");
var bucket = cluster.OpenBucket("bucket name");
bucket.Ping();
stopWatch.Stop();
Console.WriteLine($"{stopWatch.ElapsedMilliseconds} ms");
}
}
}
I’m using the same IP address, user name, password, and bucket name (obscured here for obvious reasons).