-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
[MultidomainBundle] Improve domain based locale router performance #3444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you mentioned already, we need to keep BC and can't remove those properties and methods (or change visibility)
I like the performance improvements here, so indeed with some kind of option/toggle would be ideal to make improvements and keep BC. Do you have any numbers on the improvement itself? Like blackfire profile of some timings of real apps?
b010a60
to
c54dbff
Compare
c54dbff
to
ee41e29
Compare
@acrobat I pushed some changed. I cannot generate the same blackfire profile as before because we have changed a lot. But the main thing is that is reduced calls to getHost and isMultiLanuage methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dannyvw small remark regarding the deprecation message and suggested config. Otherwise PR is good to go 👌
src/Kunstmaan/MultiDomainBundle/Router/DomainBasedLocaleRouter.php
Outdated
Show resolved
Hide resolved
Thanks @dannyvw! |
This line https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/7.x/src/Kunstmaan/MultiDomainBundle/Router/DomainBasedLocaleRouter.php#L175 decrease performance when you have many links. The "isMultiLanguage" check is also done inside "getSlugRouteParameters" so it is not necessary to perform that inside the "getRouteCollection" for every link. Runtime checks inside "getRouteCollection" are slow (https://github.com/symfony/symfony/blob/7.2/src/Symfony/Component/Routing/RouterInterface.php#L29)
We have about 20/25% profit on a page with only a menu and footer.
The only BC break is as the removed methods are overridden. We can solve it maybe with an config setting to switch to the improved router? Is this needed to implement?