High Performance Rails(speakerdeck.com)
speakerdeck.com
High Performance Rails
https://speakerdeck.com/mirakui/high-performance-rails-long-edition
3 comments
Are 1,000+ models really necessary for a recipe sharing application?
This is a nice overview of how to get the best performance out of modern Rails app.
Can someone speak to the difference between the two routes shown, and why exactly one is significantly more performant than the other?
e.g.
link_to 'hello', hello_index_url
vs.
link_to 'hello', controller: 'hello', action: 'index'
The fact that the first resolves orders of magnitude faster than the second seems counter intuitive.
e.g.
link_to 'hello', hello_index_url
vs.
link_to 'hello', controller: 'hello', action: 'index'
The fact that the first resolves orders of magnitude faster than the second seems counter intuitive.
The first form generates a method at startup time that can be pre-configured to do all the work necessary.
The second form has to perform a pattern match with the controller and action names to work out which method to call, and then call the method generated by the first form.
This extra pattern match is the overhead, and with thousands of routes, it clearly adds up.
Always use named routes - the first form.
The second form has to perform a pattern match with the controller and action names to work out which method to call, and then call the method generated by the first form.
This extra pattern match is the overhead, and with thousands of routes, it clearly adds up.
Always use named routes - the first form.