-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf: Handle small requests more efficiently #1374
Comments
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//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. |
GetBulkStateAsync
operation
@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. |
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:
== APP == === PROFILING RESULTS === == APP == == APP == MYPC at 10/21/2024 6:58:21 AM == APP == My Profiler Name 0ms == APP == >> Main Work 98.84ms == APP == >>>> Load state 66.67ms == APP == >>>>>> Bulk op 66.1ms == APP == >>>> Load dict 7.87ms
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.The text was updated successfully, but these errors were encountered: