-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
RedirectRule: opportunity for performance improvement #28883
Comments
Have you done any profiling here? This is a class of issue that's unlikely to be addressed unless it shows up as significant in a CPU or memory profile.
|
If you follow the You're right about the However, the |
It also has an overload for PathString + string. |
Got it! But that means that
will end up being
Right? One more string than it needs to be. If we accept that |
Fair point. As you said, |
Are there any unit tests for this? If so, where? |
Found! MiddlewareTests.cs |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Summary
RedirectRule.ApplyRule
is comparing the request path withPathString.Empty
, which ends up being a string comparison.RedirectRule.ApplyRule
is boxing aPathString
(1)(2).Motivation and goals
This is in a hot path for applications that use redirections.
Detailed design
path.HasValue
instead.pathBase.ToUriComponent()
instead.UriHelper.BuildRelative
. The current implementation doesn't encode the path; only the path base and the query string.The text was updated successfully, but these errors were encountered: