Skip to content

System.Net.WebProxy Bypass regex list optimization - #73803

Merged
stephentoub merged 3 commits into
dotnet:mainfrom
onehourlate:issue-73703
Aug 14, 2022
Merged

System.Net.WebProxy Bypass regex list optimization#73803
stephentoub merged 3 commits into
dotnet:mainfrom
onehourlate:issue-73703

Conversation

@onehourlate

Copy link
Copy Markdown
Contributor

Added change tracking to BypassArrayList to avoid reconstructing the bypass regex list at every call of IsBypassed

Fix#73703

@ghostghost added area-System.Net community-contribution Indicates that the PR has been added by a community member labels Aug 11, 2022
@dnfadmin

dnfadmin commented Aug 11, 2022

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@ghost

Copy link
Copy Markdown

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

Issue Details

Added change tracking to BypassArrayList to avoid reconstructing the bypass regex list at every call of IsBypassed

Fix #73703

Author:onehourlate
Assignees:-
Labels:

area-System.Net

Milestone:-

Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
Comment threadsrc/libraries/System.Net.WebProxy/tests/WebProxyTest.cs Outdated

@stephentoubstephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comments, the change generally LGTM. Thanks for working on this.

Comment threadsrc/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Outdated
@stephentoubstephentoub added this to the 7.0.0 milestone Aug 12, 2022
Blaise Lepeupleand others added 3 commits August 14, 2022 07:58
Added change tracking to BypassArrayList to avoid reconstructing the bypass regex list at every call of IsBypassed
Fixdotnet#73703
DirtyTrackingArrayList => ChangeTrackingArrayList.
IsDirty => IsChanged
Inner class moved to end
Ditched weird bool CheckDirty() with side effect in favor of void ResetIsChanged()
@stephentoub

Copy link
Copy Markdown
Member

As we have a deadline of tomorrow, I've addressed the open feedback and pushed a new commit. Thanks.

@onehourlate

Copy link
Copy Markdown
ContributorAuthor

Ok.
Sorry, it wasn't clear to me you were waiting for more changes...
The fact that I didn't quite agree with the suggested changes didn't help ;)

I should have added all the possible mutation tests cases, tough : that's obviously a plus.

I don't like reflection in Unit Tests either, but I would have kept that test : with the current unit tests, the initial code would pass. I thought it was a net positive (despite the use of reflexion), to have unit tests that failed for the original code.

Anyway.
To be clear : do I still have something to do for this PR, or is it now going its merry way ?

@stephentoub

Copy link
Copy Markdown
Member

Sorry

No problem.

with the current unit tests, the initial code would pass

There are literally thousands of places things are cached around the core libraries, and except where there's a visible behavioral impact, we don't have unit tests for it. If you'd like to submit a PR to add a perf test for this to dotnet/performance, that'd be welcome.

do I still have something to do for this PR

Nope, thanks.

@stephentoub
stephentoub merged commit 73ade4b into dotnet:mainAug 14, 2022
@stephentoub

Copy link
Copy Markdown
Member

Thank you, @onehourlate.

@ghostghost locked as resolved and limited conversation to collaborators Sep 13, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Netcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Net.WebProxy Bypass regex list reconstructed for every call to IsBypassed

4 participants

@onehourlate@dnfadmin@stephentoub@MihaZupan