-
Notifications
You must be signed in to change notification settings - Fork 524
Store header values as byte[] #169
Comments
FYI: This probably conflicts with the coming change from string[] to StringValues :aspnet/HttpAbstractions#361 |
Actually aspnet/HttpAbstractions#361 might make it easier as that puts the indirection in place? |
Yep this is something that could be supported by StringValues. |
This has been more or less addressed |
Reopening this in light of #367 though would probably want some kind of Would likely want the For an example use, in benchmarks /cc @davidfowl |
@CesarBS could you check if this is done already? Feel free to ping @JunTaoLuo and @Tratcher |
Will be addressed in the PR mentioned above. |
Encode and store the header values as byte[] at the point they are added to the header dictionary { set }; encoding back to string if read by user code { get }; and using the byte[] when output to the socket (alternate IEnumerable interface?).
As strings are immutable this wouldn't break user code; to change the header the value would need to be set again. Response headers aren't read back that much by user code; oauth does it; but oauth is generally slow anyway.
This would mean the server header would only need to be encoded once for the lifetime and date only encoded once per second, rather than both on every response.
Additionally it would move the encoding time out of the socket write path which may improve throughput?
More of a suggestion than something backed up by hard metrics.
The text was updated successfully, but these errors were encountered: