Pool the missing ReadAsync state machine#41345
Conversation
|
This will avoid the state machine allocation, but my guess is the overhead of pooling/unpooling/resetting the state machine will be slower than allocation + eventual GC. Need to measure. |
|
I’m not sure what we need to measure. We do this for literally all of the other state machines in the read code path, we forgot this one. I updated the description. |
|
The goal is RPS to go up and to the right. Have we tested that state machine pooling actually does that? Edit: I see #35011 had some tests. RPS was basically the same but allocations went down. Probably the same thing here. As long as we aren't pooling at the cost of RPS then go ahead. |
Right, that's the idea. Also I really hope we can someday pull this off #35011 (comment). It would be ideal to avoid TLS and just use something a field on object with the async method for this. |
Contributes to #41343, continuation of #35011