aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorLuke Gruber <luke.gru@gmail.com>2014-06-25 23:18:33 -0400
committerLuke Gruber <luke.gru@gmail.com>2014-06-25 23:18:33 -0400
commit4955c04eb664e328597dae4ab5066e1b3021a614 (patch)
tree6c27cc767840ce03810d6b6434e31783cec57387 /actionview/lib
parent18def156ba01f33255e09f18975c26b650975262 (diff)
downloadrails-4955c04eb664e328597dae4ab5066e1b3021a614.tar.gz
rails-4955c04eb664e328597dae4ab5066e1b3021a614.tar.bz2
rails-4955c04eb664e328597dae4ab5066e1b3021a614.zip
remove Set.new from DetailsKey::get, impacts rendering overhead performance
Using ruby-prof, I noticed that Set#add had the largest 'self time' percentage (5% of the overall time spent rendering) when benchmarking the rendering of a small cached ERB template that was 3 lines long. It turns out it was from this line. I don't believe the Set is necessary, either. Removing this line increases the rendering ips using Benchmark::ips accordingly.
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/lookup_context.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb
index 5fff6b0771..ac89fb0829 100644
--- a/actionview/lib/action_view/lookup_context.rb
+++ b/actionview/lib/action_view/lookup_context.rb
@@ -66,7 +66,7 @@ module ActionView
def self.get(details)
if details[:formats]
details = details.dup
- syms = Set.new Mime::SET.symbols
+ syms = Mime::SET.symbols
details[:formats] = details[:formats].select { |v|
syms.include? v
}