Module

Optimisation

Much of the slow performance from routes comes from the complexity of expiry, :requirements matching, defaults providing and figuring out which url pattern to use. With named routes we can avoid the expense of finding the right route. So if they’ve provided the right number of arguments, and have no :requirements, we can just build up a string and return it.

To support building optimisations for other common cases, the generation code is separated into several classes

Classes
Optimiser
PositionalArguments Given a route: map.person ’/people/:id’
PositionalArgumentsWithAdditionalParams This case is mostly the same as the positional arguments case above, but it supports additional query parameters as the last argument
Constants
OPTIMISERS
Public Methods
generate_optimisation_block
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.