You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 4.1-dev branch.
Discussion
----------
[Routing] Fix same-prefix aggregation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The blog post on http://symfony.com/blog/new-in-symfony-4-1-fastest-php-router made me review the aggregation logic, and discover issues.
So now, instead of this:
```
.'|/(en|fr)/admin/post/?(*:82)'
.'|/(en|fr)/admin/post/new(*:166)'
.'|/(en|fr)/admin/post/(\\d+)(*:253)'
.'|/(en|fr)/admin/post/(\\d+)/edit(*:345)'
.'|/(en|fr)/admin/post/(\\d+)/delete(*:442)'
.'|/(en|fr)/blog/?(*:519)'
.'|/(en|fr)/blog/rss\\.xml(*:603)'
.'|/(en|fr)/blog/page/([^/]++)(*:694)'
.'|/(en|fr)/blog/posts/([^/]++)(*:784)'
.'|/(en|fr)/blog/comment/(\d+)/new(*:880)'
.'|/(en|fr)/blog/search(*:962)'
.'|/(en|fr)/login(*:1038)'
.'|/(en|fr)/logout(*:1116)'
.'|/(en|fr)?(*:1188)'
```
we generate this:
```
.'|/(en|fr)(?'
.'|/admin/post(?'
.'|/?(*:34)'
.'|/new(*:45)'
.'|/(\\d+)(?'
.'|(*:61)'
.'|/edit(*:73)'
.'|/delete(*:87)'
.')'
.')'
.'|/blog(?'
.'|/?(*:106)'
.'|/rss\\.xml(*:123)'
.'|/p(?'
.'|age/([^/]++)(*:148)'
.'|osts/([^/]++)(*:169)'
.')'
.'|/comments/(\\d+)/new(*:197)'
.'|/search(*:212)'
.')'
.'|/log(?'
.'|in(*:230)'
.'|out(*:241)'
.')'
.')'
.'|/(en|fr)?(*:260)'
```
This is not only another perf fix, but a real bug fix, as I found ordering issues.
Commits
-------
d514f81 [Routing] Fix same-prefix aggregation
0 commit comments