nathanl/authority — pull request #53 by dwbutler (2013-08-20 22:45:38+00:00)
Title: Memoization

See https://github.com/nathanl/authority/issues/52

This is my proof of concept implementation of memoization for Authority (using the `memoist` gem since ActiveSupport has removed memoization). It is opt-in via a new configuration parameter, `config.memoization = true`. The `authorizer` instance on the model is memoized, as well as each adjective method in every Authorizer class. The authorizer memoization cache can be reset via the model by calling `model.flush_authorizer_cache`.

This change improves the performance of my application by ~100%.

If this looks like something you'd like to merge, I'll go ahead and add specs and readme documentation.

Thanks!