-
Notifications
You must be signed in to change notification settings - Fork 156
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
Improve performance of ProtocolReader #20
Comments
Turns out this is hard because the IValueTaskSource can't use the result type (TResult). The method is generic but the type isn't. This is more complicated and would require a cache per TResult. As a best effort, the code tries to avoid the state machine when the buffer is there. |
Sorry for being nosy, but this is a fascinating repo. What about a generic version of ProtocolReader? It looks like the common case is to read the same type repeatedly, so perhaps it would be worthwhile to optimize for that case? You would be able to use Also, how difficult is implementing |
Funny, it used to be generic then it was made non generic. Maybe it makes sense to have both.
Much easier than it used to be, but still not completely trivial. |
One reason the generic reader was remove was to allow composing protocols like this BedrockFramework/src/Bedrock.Framework.Experimental/Protocols/HttpClientProtocol.cs Line 19 in 08273ea
|
Perhaps rename the non-generic version to "MultiProtocolReader" or something? |
There are a few things that can be done to improve the performance of the ProtocolReader:
The text was updated successfully, but these errors were encountered: