From 4955c04eb664e328597dae4ab5066e1b3021a614 Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Wed, 25 Jun 2014 23:18:33 -0400 Subject: 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. --- actionview/lib/action_view/lookup_context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib') 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 } -- cgit v1.2.3