Skip to content

T17015 router performance enhancement#17016

Merged
niden merged 5 commits into
5.0.xfrom
T17015-router-performance-enhancement
May 14, 2026
Merged

T17015 router performance enhancement#17016
niden merged 5 commits into
5.0.xfrom
T17015-router-performance-enhancement

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented May 13, 2026

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Added Phalcon\Mvc\Router::getMethodRoutes(): array - returns the internal HTTP-method index (routes bucketed by method string, unconstrained routes under "*"). handle() now builds a candidate list from only the matching-method bucket plus the unconstrained bucket and iterates that subset in reverse, eliminating the O(n) per-route HTTP-method check that previously ran against every registered route on each request

Thanks

@niden niden self-assigned this May 13, 2026
@niden niden requested a review from Jeckerson May 13, 2026 21:41
@niden niden added new feature request Planned Feature or New Feature Request 5.0 The issues we want to solve in the 5.0 release labels May 13, 2026
Base automatically changed from T17007-url-hostname to 5.0.x May 14, 2026 16:04
@niden niden merged commit 21959df into 5.0.x May 14, 2026
96 checks passed
@niden niden deleted the T17015-router-performance-enhancement branch May 14, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 The issues we want to solve in the 5.0 release new feature request Planned Feature or New Feature Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant