News for hackers. Stuff that matters.
Re:High Performance Rails by doktrin on Friday May 31, 2013 @10:14PM (#5802339)
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.

Re:High Performance Rails by tomfakes on Friday May 31, 2013 @10:22PM (#5802355)
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.

Re:High Performance Rails by tomfakes on Friday May 31, 2013 @09:56PM (#5802268)
This is a nice overview of how to get the best performance out of modern Rails app.
Re:High Performance Rails by rapcal on Saturday June 01, 2013 @10:25PM (#5807048)
Are 1,000+ models really necessary for a recipe sharing application?