Add Lease and non-boxing versions of Execute(Async)#2844
Add Lease and non-boxing versions of Execute(Async)#2844kevin-montrose wants to merge 7 commits intoStackExchange:mainfrom
Conversation
…Explicit)(Async)) methods; can revert depending on feedback
|
Hey Monty; what's your timescales? Basically, I have a side branch that completely rewrites the fundamental writer/parser core, and one of the secondary aims is to enable zero-alloc custom commands from external callers. Assuming you're coming at this with your work hat on, we could perhaps use yourself as a 1st party client to give me an excuse to merge that work on company time. |
@mgravell It's short but not imminent - second week of February would be ideal. To expand on the use case, this is a benchmarking tool. I suspect the functionality that is being Execute'd is already fast enough, but cannot prove it. Based on profiling, I believe my extra tail latency is allocation / GC related. |
|
|
|
Considerations:
We're discussing this directly (off-GitHub), and will keep doing so. |

I've got a scenario where I need to do a ton of
.Execute(Async)calls, and the lack of ways to avoid allocations are hurting.So I've added some.
Added methods (generally on both
IServerandIDatabase(Async), as paired with existingExecute(Async)methods):ExecuteLease(Async)Lease<byte>?(orTask<Lease<byte>?>) - documented as only allowing simple string, bulk string, and integer returns per-LeaseProcessorbehaviorExecuteLeaseExplicit(Async)paramsExcuteLease(Async)methods except rather than taking anICollection<object>it takes anICollection<RedisKey>and anICollection<RedisValue>MessageaccordinglyRedisKeyvalues are not passed, they are only used to determine slots when cluster is enabledNotSupportExceptions ifExecuteLeaseExplicit(Async)methods are calledI'm not married to these exact methods, but they seem the simplest way to get Execute-ish functionality without boxing and while reusing result allocations.