aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorStan Lo <a22301613@yahoo.com.tw>2017-02-07 00:31:44 +0800
committerStan Lo <a22301613@yahoo.com.tw>2017-02-07 00:41:02 +0800
commitdde7134e07cb84f2efcf9704de144ef9ed38d360 (patch)
treeffebf9e8e045960c11b6a14d1a3cd8a433fe1e22 /actionmailer/lib
parente3afc83631ebe2dbb3c4368756577bdd92ea1d62 (diff)
downloadrails-dde7134e07cb84f2efcf9704de144ef9ed38d360.tar.gz
rails-dde7134e07cb84f2efcf9704de144ef9ed38d360.tar.bz2
rails-dde7134e07cb84f2efcf9704de144ef9ed38d360.zip
Freeze fragment cache related instrument name.
ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 444be944df..9b5d39faea 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -972,7 +972,7 @@ module ActionMailer
end
def instrument_name
- "action_mailer"
+ "action_mailer".freeze
end
ActiveSupport.run_load_hooks(:action_mailer, self)