Remove the method attribute in links#4
Merged
kimlai merged 1 commit intolrqdo:masterfrom Aug 23, 2016
Merged
Conversation
The current implementation uses the `Router::getRouteCollection` method, which loads all routes. If you use yaml to define your routes, it will parse all route files, which has a pretty big performance impact on a large application with many routes. This method is actually intended to be used to warm up the cache and nothing else (the result is cached in memory, but every request will read the configuration with no cache involved). See symfony/symfony#7368 (comment) for a discussion on this topic. We could implement a router that can do what we need efficiently, but given that we don't use the `method` attribute, let's just remove it completely. Note : Blackfire says that this change leads to a -200ms improvement in an app with 260 routes.
|
👍 |
1 similar comment
|
👍 |
|
And by the way, the 👍 |
Author
|
@trompette If it's not, how do you know which verb to use when following a link ? |
|
@kimlai it looks like links are designed to specify URIs not the way you interact with the resource identified by the URI. Ref: https://apigility.org/documentation/api-primer/halprimer |
Author
|
Yeah that's what I figured after re-reading the spec. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation uses the
Router::getRouteCollectionmethod, which loads all routes. If you use yaml to define your routes, it will parse all route files, which has a pretty big performance impact on alarge application with many routes.
This method is actually intended to be used to warm up the cache and nothing else (the result is cached in memory, but every request will read the configuration with no cache involved).
See symfony/symfony#7368 (comment) for a discussion on this topic.
We could implement a router that can do what we need efficiently, but given that we don't use the
methodattribute, let's just remove it completely.Note : Blackfire says that this change leads to a -200ms improvement in an app with 260 routes.