Skip to content

Improve routing performance with constant stackalloc when matching #32569

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

Open
JamesNK opened this issue May 11, 2021 · 4 comments
Open

Improve routing performance with constant stackalloc when matching #32569

JamesNK opened this issue May 11, 2021 · 4 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-routing Perf task
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented May 11, 2021

A possible place to improve matching performance is using a constant stackalloc:

// First tokenize the path into series of segments.
Span<PathSegment> buffer = stackalloc PathSegment[_maxSegmentCount];
var count = FastPathTokenizer.Tokenize(path, buffer);
var segments = buffer.Slice(0, count);

At the moment the maximum required size is calculated. Could use a constant size up to a limit (64?), and then switch to allocating array or array pool.

Verify any changes with performance tests.

@javiercn javiercn added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-routing labels May 11, 2021
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label May 11, 2021
@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone May 11, 2021
@ghost
Copy link

ghost commented May 11, 2021

Thanks for contacting us.

We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT
Copy link
Contributor

@JamesNK is this done already?

@JamesNK
Copy link
Member Author

JamesNK commented Aug 10, 2021

@mkArtakMSFT mkArtakMSFT added task and removed enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Aug 12, 2021
@pranavkm pranavkm modified the milestones: 6.0-rc2, Backlog Aug 25, 2021
@ghost
Copy link

ghost commented Aug 25, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-routing Perf task
Projects
None yet
Development

No branches or pull requests

4 participants