mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
18def156ba
commit
4955c04eb6
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ module ActionView
|
||||||
def self.get(details)
|
def self.get(details)
|
||||||
if details[:formats]
|
if details[:formats]
|
||||||
details = details.dup
|
details = details.dup
|
||||||
syms = Set.new Mime::SET.symbols
|
syms = Mime::SET.symbols
|
||||||
details[:formats] = details[:formats].select { |v|
|
details[:formats] = details[:formats].select { |v|
|
||||||
syms.include? v
|
syms.include? v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue