-
Notifications
You must be signed in to change notification settings - Fork 193
Reduce allocations by using StringSegment in parsers #758
Comments
This could be done either as an internal optimization to the existing parsers (to limited effect) or by creating a new version that directly exposes StringSegment on the resulting object model. Thus far we have not exposed StringSegment in public APIs. |
@BrennanConroy also suggest looking into using spans if available and possible. Could also see if that applies to StringSegment in Common as well. |
Note MVC has already done something like this. They cloned the existing parsers and reworked them in their own private library to be more efficient. We should try to reclaim those. |
proposal: consolidate our custom header parsing. We should look at Mvc, Localization, HeaderUtilties, and StaticFiles. |
@muratg please file a new bug for the consolidation work. |
Consolidation work: #825 |
We can potentially reduce the amount of allocations if we expose some of the parsed types and intermediate tokens as StringSegment instead of strings by removing the need to call Substring everywhere.
The text was updated successfully, but these errors were encountered: