-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Labels
Perfarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-routing
Milestone
Description
Today, when using a regex route constraint, we create a new Regex:
aspnetcore/src/Http/Routing/src/Constraints/RegexRouteConstraint.cs
Lines 40 to 43 in e523876
| Constraint = new Regex( | |
| regexPattern, | |
| RegexOptions.CultureInvariant | RegexOptions.IgnoreCase, | |
| RegexMatchTimeout); |
This should use the RegexOptions.Compiled as well. That way we aren't interpreting these regular expressions every time the route is inspected.
Our docs even say this should be using Compiled:
The ASP.NET Core framework adds RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant to the regular expression constructor. See RegexOptions for a description of these members.
Metadata
Metadata
Assignees
Labels
Perfarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-routing