Net SDK 3 performance

@weezelboy

No, I would not expect any noticeable performance impact from using the DI infrastructure. It’s basically comparable to putting the ICluster in your DI system yourself and calling BucketAsync() on the ICluster. It’s a very thin wrapper. Of course, the DI system itself will incur some overhead compared to a global static variable. But since .NET Core is so built on DI anyway I wouldn’t be concerned.

Thanks @btburnett3, any timeframe on the new .NET SDK release?

@jmorris will have to speak to release time frames.

However, here is a list of the work completed so far for the 3.1.1 release (assuming no issues in final testing require a revert): https://issues.couchbase.com/issues/?jql=project%20%3D%20NCBC%20AND%20status%20in%20(Resolved%2C%20Closed)%20AND%20fixVersion%20%3D%203.1.1%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC

@weezelboy -

Releases are scheduled the first Tuesday of each week; next (3.1.1) is planned for January 5th, 2021. In certain circumstances we release off-schedule, but its an internal decision. The release schedule can be found in the Couchbase .NET Client Library project in Jira.

Note that you can always pull the source from its Github repo and build it; the master branch is the current development branch and releases are tagged.

-Jeff

@jmorris It is Jan 8, and so far I don’t see 3.1.1 released yet, do you have an updated date in when it will be released to NuGet?

The link Couchbase .NET Client Library project in Jira.

Does not allow me access to see it :slight_smile:

Hi @Brian_Davis -

Due to the holidays 3.1.1 date was moved to January 12th 2021.

-Jeff

Hi Jeff,

Do you know what time today it will be released?

Thanks,

Brian Davis

Hi @Brian_Davis -

It looks like there are some QE delays, so it looks likely a release will happen tomorrow. There is no exact time it will be released.

-Jeff

Thanks for the update.

Hi Jeff,

Any updates on the 3.1.1 Release?

Thanks,

Brian Davis

Hi @Brian_Davis -

It’s passed QE and should be up on NuGet soon. I’ll post a update when it is.

-Jeff

@Brian_Davis -

Couchbase SDK 3.1.1 now available on NuGet!

1 Like

Hi @jmorris

Thanks for your help and updating me on latest status of this release, testing it out now, will let you know if I find or have any issues.

:slight_smile:

1 Like

@jzissop

Had you tried version 3.1.1 out yet?

Are you having same issues with it?

I am still noticing Get operations are still slower than they were in 2.x SDK.

Any updates on this?

@btburnett3 @jmorris

Thanks,

Brian Davis

@Brian_Davis

Can you provide the code you’re using to benchmark? On my machine, in certain test cases, I’ve been able to get as high as 15k gets per second, which is much higher than I was getting on 2.x. I’m wondering if there may be a benchmark design issue? Having the source will help me sort that out and replicate the problem.

Also, what version of the .NET runtime are you using? A lot of the performance optimizations are most effective on Core 3.1 and later.

Hi
@btburnett3

Currently using a remote server that has 2.x vs another server that is using 3.1.1 for the client, and then comparing loading speeds of same page for both server and the 2.x is loading faster than one using 3.1.1.

Had not done any specific Unit benchmark testing of just the Get Method by itself yet.

Currently we are using Core 3.1

But, to make it backwards compatible with our previous code that was using 2.x I am calling it with Sync method that has a wrapper using the Async method for 3.1.1

So currently testing now with a different method that is ASYNC through out entire stack, going to see if that speeds things up or not.

If you’re using the AsyncHelper.RunSync trick, that could be the culprit. It tends to cause thread pool depletion, which can negatively impact performance. Especially early in the lifecycle of the application, or during load spikes, because there are throttles on how fast the thread pool in .NET is allowed to grow. Let me know how it goes.

Main issue is with trying to simulate 2.x “MultiGet” in 3.1.1

This is the code currently using:

@Brian_Davis

Yeah, doing the multi get well using Tasks is a bit tricky. I’ve been playing with making an extension library to implement a best practice pattern, but it’s not done yet.

See this post on info on how to optimize the process: Bulk Insert In Every Two Minutes - #4 by btburnett3

Also, you can address the exception thrown on await Task.WhenAll(...) like this:

try
{
    await Task.WhenAll(tasks);
}
catch
{
    // Exception will be of any type, just ignore
}

foreach (var task in tasks)
{
    if (task.IsCompletedSuccessfully)
    {
        // Do something with task.Result
    }
    else
    {
        // Do something with task.Exception
    }
}
1 Like

@Brian_Davis

Did removing the use of a sync method calling an async method resolve your problem?