

High Performance Rails - matsuu
https://speakerdeck.com/mirakui/high-performance-rails-long-edition

======
doktrin
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.

~~~
tomfakes
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.

------
tomfakes
This is a nice overview of how to get the best performance out of modern Rails
app.

------
rapcal
Are 1,000+ models really necessary for a recipe sharing application?

