amatsuda/active_decorator — pull request #7 by rhulse (2012-03-18 21:58:36+00:00)
Title: Cache nil results for decorator_for.

This avoids the expensive and repeated calls to constantize for classes where there isn't a corresponding Decorator implementation.

Given that every single argument to every single render is decorated, our application was spending a long time looking up StringDecorator and FixnumDecorator, with every call generating a NameError, rescuing it and returning nil. Caching this made a material difference to our rendering time.