diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-22 10:27:32 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-22 10:27:32 -0500 |
commit | bc5896e708bf8070835bebe61de03b701fa5e6f7 (patch) | |
tree | e244324bec641c94eca09b25bb9decba0f4699c0 /actionpack/lib/action_view/base.rb | |
parent | 8a87d8a6c2c6dfb423bcaf61c750010d80993b16 (diff) | |
download | rails-bc5896e708bf8070835bebe61de03b701fa5e6f7.tar.gz rails-bc5896e708bf8070835bebe61de03b701fa5e6f7.tar.bz2 rails-bc5896e708bf8070835bebe61de03b701fa5e6f7.zip |
Memoize ActionView::Base pick_template and find_partial_path for rendering duration
Diffstat (limited to 'actionpack/lib/action_view/base.rb')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 619a4270f8..bdcb1dc246 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -323,8 +323,8 @@ module ActionView #:nodoc: if self.class.warn_cache_misses && logger = ActionController::Base.logger logger.debug "[PERFORMANCE] Rendering a template that was " + "not found in view path. Templates outside the view path are " + - "not cached and result in expensive disk operations. Move this " + - "file into #{view_paths.join(':')} or add the folder to your " + + "not cached and result in expensive disk operations. Move this " + + "file into #{view_paths.join(':')} or add the folder to your " + "view path list" end @@ -332,6 +332,9 @@ module ActionView #:nodoc: end end + extend ActiveSupport::Memoizable + memoize :pick_template + private # Renders the template present at <tt>template_path</tt>. The hash in <tt>local_assigns</tt> # is made available as local variables. |