3 ms·
High Performance Rails
- tomfakes 13y agoThis is a nice overview of how to get the best performance out of modern Rails app.
- doktrin 13y agoCan 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 13y agoThe 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.
- rapcal 13y agoAre 1,000+ models really necessary for a recipe sharing application?