Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Reduce allocations by using StringSegment in parsers #758

Closed
JunTaoLuo opened this issue Jan 19, 2017 · 9 comments
Closed

Reduce allocations by using StringSegment in parsers #758

JunTaoLuo opened this issue Jan 19, 2017 · 9 comments

Comments

@JunTaoLuo
Copy link
Contributor

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.

@Tratcher
Copy link
Member

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.

@JunTaoLuo JunTaoLuo added the Perf label Jan 19, 2017
@JunTaoLuo
Copy link
Contributor Author

@BrennanConroy also suggest looking into using spans if available and possible. Could also see if that applies to StringSegment in Common as well.

@Tratcher
Copy link
Member

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.

@muratg muratg added this to the 2.0.0 milestone Feb 3, 2017
@JunTaoLuo JunTaoLuo self-assigned this Feb 23, 2017
@JunTaoLuo
Copy link
Contributor Author

proposal: consolidate our custom header parsing. We should look at Mvc, Localization, HeaderUtilties, and StaticFiles.

@Tratcher
Copy link
Member

Tratcher commented Apr 3, 2017

dotnet/extensions#213

@muratg muratg modified the milestones: 2.0.0-preview1, 2.0.0-preview2 Apr 21, 2017
@Eilon
Copy link
Member

Eilon commented Apr 24, 2017

@muratg please file a new bug for the consolidation work.

@muratg
Copy link

muratg commented Apr 24, 2017

Consolidation work: #825

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants