Open AlbertoVPersonal opened 1 month ago
As discussed in Discord, I believe the issue here is not specific to this method, but rather one of the overhead of using gRPC in the SDK for all requests where the issue author is instead opting to use the HTTP API for their PowerShell sample.
The 1.15 release will come with some (significant package updates)[https://github.com/dapr/dotnet-sdk/pull/1366} which have hopefully themselves added performance boosts.
Further, given a large enough bulk operation (as with the amount of data transferred in other client operations), I would expect that there's a point somewhere that the gRPC operation becomes more performant than the HTTP approach (primarily as binary encoding is smaller), but I don't know where that is for each operation.
Regardless, this is worth keeping in mind when designing the next generation state stores to look at opportunities to handle small requests more efficiently.
@AlbertoVPersonal How many times are you running this test in your .NET code?
I wonder if there is an initial penalty/tax on that first operation, and subsequent operations will be faster?
Usually I run a minimum of ten times at least because it is my baseline in my benchmark project. For other tests, I usually run during 100 and 1000 iterations.
Yes, .NET has a penalty on the first run so by that reason I run it several times. And my times are an average. Maybe your data could be better. It is a choice.
@olitomlinson
Expected Behavior
If it was possible, to reduce the time of the method
GetBulkStateAsync
lower than 10 ms.Actual Behavior
The current operation takes about
64 ms
to read four keys.Steps to Reproduce the Problem
Scenario configuration
Description
In my scenario, I have profiled the code using the
MiniProfiler.NET
package.And one of the tests have delivered these results:
In this code we can conclude that:
I have done some tests using PowerShell calling to the State API and the results are much better (
Duration: 00:00:00.0040811 ms
).Release Note
RELEASE NOTE: IMPROVEMENT Better performance in the
GetBulkStateAsync
operation.