Skip to content

Avoid url string allocation in WebProxy.IsMatchInBypassList #73807

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

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Aug 11, 2022

Use new the Regex.IsMatch(span) overload to avoid allocating a new string on each call. On its own this won't move the needle much, but once #73803 is in, IsMatchInBypassList will be allocation-free for all reasonable input Uris (and we could change it to use ArrayPool in the future if we found hosts that were frequently longer than this).

cc: @dotnet/ncl, @joperezr, @onehourlate

@stephentoub stephentoub added the tenet-performance Performance related issue label Aug 11, 2022
@stephentoub stephentoub added this to the 7.0.0 milestone Aug 11, 2022
@ghost ghost added the area-System.Net label Aug 11, 2022
@ghost ghost assigned stephentoub Aug 11, 2022
@ghost
Copy link

ghost commented Aug 11, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Use new the Regex.IsMatch(span) overload to avoid allocating a new string on each call. On its own this won't move the needle much, but once #73803 is in, IsMatchInBypassList will be allocation-free for all reasonable input Uris (and we could change it to use ArrayPool in the future if we found hosts that were frequently longer than this).

cc: @dotnet/ncl, @joperezr

Author: stephentoub
Assignees: -
Labels:

area-System.Net, tenet-performance

Milestone: 7.0.0

@stephentoub stephentoub force-pushed the matchbypassliststring branch from 858fe2d to af7b878 Compare August 11, 2022 19:46
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
@stephentoub stephentoub merged commit 7262fe1 into dotnet:main Aug 12, 2022
@stephentoub stephentoub deleted the matchbypassliststring branch August 12, 2022 04:09
@ghost ghost locked as resolved and limited conversation to collaborators Sep 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net tenet-performance Performance related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants